This commit was manufactured by cvs2svn to create tag 'R1_0_2'.
diff --git a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
index 1f59675..975e202 100644
--- a/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.jsp.core; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.2.qualifier
 Bundle-Activator: org.eclipse.jst.jsp.core.internal.JSPCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -26,9 +26,12 @@
  org.eclipse.jst.jsp.core.internal.provisional.contenttype,
  org.eclipse.jst.jsp.core.internal.provisional.text,
  org.eclipse.jst.jsp.core.internal.regions,
+ org.eclipse.jst.jsp.core.internal.taglib,
  org.eclipse.jst.jsp.core.internal.tasks,
  org.eclipse.jst.jsp.core.internal.text,
  org.eclipse.jst.jsp.core.internal.util,
+ org.eclipse.jst.jsp.core.internal.validation,
+ org.eclipse.jst.jsp.core.jspel,
  org.eclipse.jst.jsp.core.taglib
 Require-Bundle: org.eclipse.core.runtime,
  org.eclipse.core.resources,
diff --git a/bundles/org.eclipse.jst.jsp.core/build.properties b/bundles/org.eclipse.jst.jsp.core/build.properties
index 9bcd78a..ae187ae 100644
--- a/bundles/org.eclipse.jst.jsp.core/build.properties
+++ b/bundles/org.eclipse.jst.jsp.core/build.properties
@@ -17,6 +17,6 @@
 bin.excludes = @dot/**,\
                temp.folder/**
 src.includes = component.xml,\
-               build.properties,\
-               DevTimeSupport/
+               DevTimeSupport/,\
+               schema/
 source.. = src/
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.properties b/bundles/org.eclipse.jst.jsp.core/plugin.properties
index b474eb2..9d662e3 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.properties
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.properties
@@ -18,3 +18,4 @@
 JSP_Syntax_Validator.name=JSP Syntax Validator
 EL_Syntax_Validator.name=EL Syntax Validator
 Structured_JSP_Document_Setup_participant.name=Structured JSP Document Setup Participant
+JSP_EL_Translator=JSP EL Translator
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/plugin.xml b/bundles/org.eclipse.jst.jsp.core/plugin.xml
index 0d76272..8684199 100644
--- a/bundles/org.eclipse.jst.jsp.core/plugin.xml
+++ b/bundles/org.eclipse.jst.jsp.core/plugin.xml
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?eclipse version="3.0"?>
 <plugin>
+   <extension-point id="elTranslator" name="%JSP_EL_Translator" schema="schema/eltranslator.exsd"/>
 
 	<extension point="org.eclipse.wst.sse.core.modelHandler">
 		<modelHandler
@@ -240,4 +241,11 @@
 			</contentTypeIdentifier>
 		</validator>
 	</extension>
+    <extension
+       point="org.eclipse.jst.jsp.core.elTranslator">
+       <elTranslator
+          class="org.eclipse.jst.jsp.core.internal.java.jspel.JSPELTranslator"
+          name="Default JSP 2.0 EL Translator"
+          id="org.eclipse.jst.jsp.defaultJSP20"/>
+    </extension>
 </plugin>
diff --git a/bundles/org.eclipse.jst.jsp.core/schema/eltranslator.exsd b/bundles/org.eclipse.jst.jsp.core/schema/eltranslator.exsd
new file mode 100644
index 0000000..34e412b
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/schema/eltranslator.exsd
@@ -0,0 +1,121 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.jst.jsp.core">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.jst.jsp.core" id="elTranslator" name="JSP EL Translator"/>
+      </appInfo>
+      <documentation>
+         Extension point to customer JSP Expression Language Generation
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="elTranslator"/>
+         </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="elTranslator">
+      <annotation>
+         <appInfo>
+            <meta.element labelAttribute="name"/>
+         </appInfo>
+      </annotation>
+      <complexType>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  Fully qualified class name for the EL Translator.  Must be an implementor of org.eclipse.jst.jsp.core.jspel.IJSPELTranslator.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  The name of the EL translator.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string" use="required">
+            <annotation>
+               <documentation>
+                  A unique string identifier for an EL Translator.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java
index b517b45..8318040 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/encoding/JSPDocumentLoader.java
@@ -79,7 +79,7 @@
 		super();
 	}
 
-	private void addNestablePrefix(JSPSourceParser parser, String tagName) {
+	protected void addNestablePrefix(JSPSourceParser parser, String tagName) {
 		TagMarker bm = new TagMarker(tagName);
 		parser.addNestablePrefix(bm);
 	}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ELProblem.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ELProblem.java
deleted file mode 100644
index b856058..0000000
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/ELProblem.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.eclipse.jst.jsp.core.internal.java;
-
-import org.eclipse.jface.text.Position;
-
-public class ELProblem {
-	private Position fPos;
-	private String fMessage;
-	
-	public ELProblem(Position pos, String message)	{
-		fPos = pos;
-		fMessage = message;
-	}
-	
-	public String getMessage() {
-		return fMessage;
-	}
-	
-
-	public Position getPosition() {
-		return fPos;
-	}
-}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
index c8702e6..265259d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslationExtension.java
@@ -15,7 +15,6 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.List;
-import java.util.StringTokenizer;
 
 import org.eclipse.core.filebuffers.ITextFileBuffer;
 import org.eclipse.core.resources.IFile;
@@ -29,9 +28,7 @@
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
 import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.TextUtilities;
 import org.eclipse.jst.jsp.core.internal.Logger;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.text.edits.DeleteEdit;
 import org.eclipse.text.edits.InsertEdit;
 import org.eclipse.text.edits.MalformedTreeException;
@@ -42,9 +39,6 @@
 import org.eclipse.wst.sse.core.internal.FileBufferModelManager;
 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.xml.core.internal.regions.DOMRegionContext;
 
 
 /**
@@ -187,11 +181,6 @@
 				}
 				else {
 					replaceText = newJavaText.substring(deltas[i].postOffset, deltas[i].postOffset + deltas[i].postLength);
-					
-					// get rid of pre and post white space or fine tuned adjustment later.
-					// fix text here...
-					replaceText = fixJspReplaceText(replaceText, jspPos.offset);
-					
 					jspEdits.add(new ReplaceEdit(jspPos.offset, jspPos.length, replaceText));
 				}
 				if(DEBUG) 
@@ -229,109 +218,6 @@
 		return allJspEdits;
 	}
 	
-	private String fixJspReplaceText(String replaceText, int jspOffset) {
-		
-		// result is the text inbetween the delimiters
-		// eg.
-		// 
-		// <%  result 
-		// %>
-		String result = replaceText.trim();
-		String preDelimiterWhitespace = "";
-		
-		IDocument jspDoc = getJspDocument();
-		if(jspDoc instanceof IStructuredDocument) {
-			IStructuredDocument sDoc = (IStructuredDocument)jspDoc;
-			IStructuredDocumentRegion[] regions = sDoc.getStructuredDocumentRegions(0, jspOffset);
-			IStructuredDocumentRegion lastRegion = regions[regions.length-1];
-			
-			// only specifically modify scriptlets
-			if(lastRegion != null && lastRegion.getType() == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN) {
-				for (int i = regions.length-1; i >= 0; i--) {
-					IStructuredDocumentRegion region = regions[i];
-					
-					// is there a better way to check whitespace?
-					if(region.getType() == DOMRegionContext.XML_CONTENT && region.getFullText().trim().equals("")) {
-						
-						preDelimiterWhitespace = region.getFullText();
-						preDelimiterWhitespace = preDelimiterWhitespace.replaceAll("\r", "");
-						preDelimiterWhitespace = preDelimiterWhitespace.replaceAll("\n", "");
-						
-						// need to determine indent for that first line...
-						 String initialIndent = getInitialIndent(result);
-						 
-						 // fix the first line of java code
-						result = TextUtilities.getDefaultLineDelimiter(sDoc) 
-									+ initialIndent 
-									+ result;
-						
-						result = adjustIndent(result, preDelimiterWhitespace, TextUtilities.getDefaultLineDelimiter(sDoc));
-						
-						// add whitespace before last delimiter to match
-					    // it w/ the opening delimiter
-						result = result + TextUtilities.getDefaultLineDelimiter(sDoc) + preDelimiterWhitespace;
-						break;
-					}
-				}
-			}
-		}
-		return result;
-	}
-	
-	private String adjustIndent(String textBefore, String indent, String delim) {
-		
-		// first replace multiple indent with single indent
-		// the triple indent occurs because the scriptlet code
-		// actually occurs under:
-		// 
-		//    class
-		//       method
-		//          code
-		// 
-		// in the translated java document
-		
-		textBefore = textBefore.replaceAll("\t\t\t", "\t");
-		
-		// get indent after 2nd line break
-		StringBuffer textAfter = new StringBuffer();
-		// will this work on mac?
-		textBefore = textBefore.replaceAll("\r", "");
-		StringTokenizer st = new StringTokenizer(textBefore, "\n", true);
-		while(st.hasMoreTokens()) {
-			String tok = st.nextToken();
-			if(tok.equals("\n")) {
-				textAfter.append(delim);
-			}
-			else {
-				// prepend each line w/ specified indent
-				textAfter.append(indent);
-				textAfter.append(tok);
-			}
-		}
-		return textAfter.toString();
-		
-	}
-	
-	private String getInitialIndent(String result) {
-		
-		// get indent after 2nd line break
-		String indent = "";
-		StringTokenizer st = new StringTokenizer(result, "\r\n", false);
-		if(st.countTokens() > 1) {
-			String tok = st.nextToken();
-			tok = st.nextToken();
-			int index =0;
-			if(tok != null) {
-				while(tok.charAt(index) == ' ' || tok.charAt(index) == '\t') {
-					indent += tok.charAt(index);
-					index++;
-				}
-			}
-		}
-		return indent;
-	}
-
-
 	/**
 	 * Combines an array of edits into one MultiTextEdit (with the appropriate coverage region)
 	 * @param edits
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
index 4807a43..41c770d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/JSPTranslator.java
@@ -25,27 +25,27 @@
 
 import org.eclipse.core.filebuffers.FileBuffers;
 import org.eclipse.core.resources.IFile;
+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.IExtensionPoint;
 import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.Path;
 import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.Position;
-import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.Logger;
 import org.eclipse.jst.jsp.core.internal.contentmodel.TaglibController;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.TLDCMDocumentManager;
 import org.eclipse.jst.jsp.core.internal.contentmodel.tld.provisional.JSP12TLDNames;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ASTExpression;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ELGenerator;
-import org.eclipse.jst.jsp.core.internal.java.jspel.JSPELParser;
-import org.eclipse.jst.jsp.core.internal.java.jspel.ParseException;
-import org.eclipse.jst.jsp.core.internal.java.jspel.Token;
-import org.eclipse.jst.jsp.core.internal.java.jspel.TokenMgrError;
 import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelper;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibHelperManager;
 import org.eclipse.jst.jsp.core.internal.taglib.TaglibVariable;
+import org.eclipse.jst.jsp.core.jspel.IJSPELTranslator;
 import org.eclipse.wst.sse.core.internal.ltk.parser.BlockMarker;
 import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
 import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
@@ -73,8 +73,22 @@
  * @author pavery
  */
 public class JSPTranslator {
+	
+	private static final String EL_TRANSLATOR_EXTENSION_NAME = "elTranslator"; //$NON-NLS-1$ 
+
+	private static final String ELTRANSLATOR_PROP_NAME = "ELTranslator"; //$NON-NLS-1$ 
+
+	// Default EL Translator
+	private static final String DEFAULT_JSP_EL_TRANSLATOR_ID = "org.eclipse.jst.jsp.defaultJSP20"; //$NON-NLS-1$ 
+	
+	// handy plugin ID constant
+	private static final String JSP_CORE_PLUGIN_ID = "org.eclipse.jst.jsp.core"; //$NON-NLS-1$ 
+
 	// for debugging
 	private static final boolean DEBUG;
+
+	private IJSPELTranslator fELTranslator = null;
+	
 	static {
 		String value = Platform.getDebugOption("org.eclipse.jst.jsp.core/debug/jspjavamapping"); //$NON-NLS-1$
 		DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
@@ -148,7 +162,7 @@
 	protected final static int DECLARATION = 2;
 	protected final static int EXPRESSION = 4;
 	protected final static int SCRIPTLET = 8;
-
+	
 	/** used to avoid infinite looping include files */
 	private Stack fIncludes = null;
 	/** mostly for helper classes, so they parse correctly */
@@ -198,14 +212,18 @@
 	 */
 	private StringBuffer fJspTextBuffer = new StringBuffer();
 	
-	/**
-	 * JSP Expression Language Parser.
-	 */
-	private JSPELParser elParser = null;
 
+	/** 
+	 * List of EL problems to be translated
+	 */
 	private ArrayList fELProblems = new ArrayList();
 
 	/**
+	 * EL Translator ID
+	 */
+	private String fELTranslatorID;
+
+	/**
 	 * configure using an XMLNode
 	 * 
 	 * @param node
@@ -215,6 +233,10 @@
 
 		fProgressMonitor = monitor;
 		fStructuredModel = node.getModel();
+		String baseLocation = fStructuredModel.getBaseLocation();
+		
+		fELTranslatorID = getELTranslatorProperty(baseLocation);
+		
 		// fPositionNode = node;
 
 		fStructuredDocument = fStructuredModel.getStructuredDocument();
@@ -237,9 +259,9 @@
 		// when configured on a file
 		// fStructuredModel, fPositionNode, fModelQuery, fStructuredDocument
 		// are all null
-
 		fProgressMonitor = monitor;
-
+		
+		fELTranslatorID = getELTranslatorProperty(jspFile);
 		String className = createClassname(jspFile);
 		if (className.length() > 0) {
 			setClassname(className);
@@ -272,6 +294,45 @@
 	}
 
 	/**
+	 * Get the value of the ELTranslator property from a workspace relative 
+	 * path string
+	 * 
+	 * @param baseLocation Workspace-relative string path
+	 * @return Value of the ELTranslator property associated with the project.
+	 */
+	private String getELTranslatorProperty(String baseLocation){
+		IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
+		String elTranslatorValue = null;
+		IFile file = workspaceRoot.getFile(new Path(baseLocation));
+		elTranslatorValue = getELTranslatorProperty(file);
+		return elTranslatorValue;
+	}
+
+	/**
+	 * Get the value of the ELTranslator property from an IFile
+	 *  
+	 * @param file IFile 
+	 * @return Value of the ELTranslator property associated with the project.
+	 */
+	private String getELTranslatorProperty(IFile file) {
+		String elTranslatorValue = null;
+		try {
+			elTranslatorValue = file.getPersistentProperty(new QualifiedName(JSP_CORE_PLUGIN_ID, ELTRANSLATOR_PROP_NAME)); //$NON-NLS-1$
+		} catch (CoreException e) {
+			Logger.logException(e);
+		}
+		
+		if(null == elTranslatorValue) {
+			try {
+				elTranslatorValue = file.getProject().getPersistentProperty(new QualifiedName(JSP_CORE_PLUGIN_ID, ELTRANSLATOR_PROP_NAME)); //$NON-NLS-1$
+			} catch (CoreException e) {
+				Logger.logException(e);
+			}
+		}
+		return elTranslatorValue;
+	}
+
+	/**
 	 * @param node
 	 * @return
 	 */
@@ -1023,32 +1084,41 @@
 	}
 	/**
 	 * translates embedded containers for ALL attribute values
+	 * 
 	 * @param regions
 	 */
 	private void checkAllAttributeValueContainers(Iterator regions) {
 		// tag name is not jsp
 		// handle embedded jsp attributes...
 		ITextRegion embedded = null;
-		Iterator attrRegions = null;
-		ITextRegion attrChunk = null;
+		//Iterator attrRegions = null;
+		//ITextRegion attrChunk = null;
 		while (regions.hasNext()) {
 			embedded = (ITextRegion) regions.next();
 			if (embedded instanceof ITextRegionContainer) {
 				// parse out container
-				attrRegions = ((ITextRegionContainer) embedded).getRegions().iterator();
-				while (attrRegions.hasNext()) {
-					attrChunk = (ITextRegion) attrRegions.next();
-					String type = attrChunk.getType();
-					// embedded JSP in attribute support only want to translate one time per
-					// embedded region so we only translate on the JSP open tags (not content)
-					if (type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN || type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN || type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN || type == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN || type == DOMJSPRegionContexts.JSP_EL_OPEN) {
-						// now call jsptranslate
-						translateEmbeddedJSPInAttribute((ITextRegionContainer) embedded);
-					}
-				}
+				
+				// https://bugs.eclipse.org/bugs/show_bug.cgi?id=130606
+				// fix exponential iteration problem w/ embedded expressions
+				translateEmbeddedJSPInAttribute((ITextRegionContainer) embedded);
+//				attrRegions = ((ITextRegionContainer) embedded).getRegions().iterator();
+//				while (attrRegions.hasNext()) {
+//					attrChunk = (ITextRegion) attrRegions.next();
+//					String type = attrChunk.getType();
+//					// embedded JSP in attribute support only want to
+//					// translate one time per
+//					// embedded region so we only translate on the JSP open
+//					// tags (not content)
+//					if (type == DOMJSPRegionContexts.JSP_EXPRESSION_OPEN || type == DOMJSPRegionContexts.JSP_SCRIPTLET_OPEN || type == DOMJSPRegionContexts.JSP_DECLARATION_OPEN || type == DOMJSPRegionContexts.JSP_DIRECTIVE_OPEN || type == DOMJSPRegionContexts.JSP_EL_OPEN) {
+//						// now call jsptranslate
+//						translateEmbeddedJSPInAttribute((ITextRegionContainer) embedded);
+//						break;
+//					}
+//				}
 			}
 		}
 	}
+	
 	/**
 	 * translates embedded container for specified attribute
 	 * @param regions
@@ -1203,31 +1273,59 @@
  }
 
 	
-	private void translateEL(String elText, IStructuredDocumentRegion currentNode, int contentStart, int contentLength) {
-		if(null == elParser) {
-			elParser = JSPELParser.createParser(elText);
-		} else {
-			elParser.ReInit(elText);
+	private void translateEL(String elText, String delim, IStructuredDocumentRegion currentNode, int contentStart, int contentLength) {
+		IJSPELTranslator translator = getELTranslator();
+		if(null != translator) {
+			translator.translateEL(elText, delim, currentNode, contentStart, contentLength, fUserELExpressions, fUserELRanges, fStructuredDocument);
 		}
-		
-		try {
-			ASTExpression expression = elParser.Expression();
-			ELGenerator gen = new ELGenerator();
-			gen.generate(expression, fUserELExpressions, fUserELRanges, this, currentNode, contentStart, contentLength);
-		} catch (ParseException e) {
-			Token curTok = e.currentToken;
-			int problemStartOffset;
-			int problemEndOffset;
-			Position pos = null;
-			problemStartOffset =  contentStart + curTok.beginColumn;
-			problemEndOffset = contentStart + curTok.endColumn;
+	}
+	
+	/**
+	 * Discover and instantiate an EL translator.
+	 */
+	public IJSPELTranslator getELTranslator() {
+		if(fELTranslator == null) {
 			
-			pos = new Position(problemStartOffset, problemEndOffset - problemStartOffset + 1);
-			fELProblems.add(new ELProblem(pos, e.getLocalizedMessage()));
-		} catch (TokenMgrError te) {
-			Position pos = new Position(contentStart, contentLength);
-			fELProblems.add(new ELProblem(pos, JSPCoreMessages.JSPEL_Token));
+			IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(
+					JSP_CORE_PLUGIN_ID, // name of plugin that exposes this extension point
+					EL_TRANSLATOR_EXTENSION_NAME); // - extension id
+
+			// Iterate over all declared extensions of this extension point.  
+			// A single plugin may extend the extension point more than once, although it's not recommended.
+			IConfigurationElement bestTranslator = null;
+			IExtension[] extensions = extensionPoint.getExtensions();
+			for(int curExtension=0; curExtension < extensions.length; curExtension++) {
+				IExtension extension = extensions[curExtension];
+				
+				IConfigurationElement[] translators = extension.getConfigurationElements();
+				for(int curTranslator = 0; curTranslator < translators.length; curTranslator++) {
+					
+					IConfigurationElement elTranslator = translators[curTranslator];
+					
+					if (!EL_TRANSLATOR_EXTENSION_NAME.equals(elTranslator.getName())) { // - name of configElement 
+						continue;
+					}
+					
+					String idString = elTranslator.getAttribute("id"); //$NON-NLS-1$
+					if(null != idString && idString.equals(fELTranslatorID) || 
+							(null == bestTranslator && DEFAULT_JSP_EL_TRANSLATOR_ID.equals(idString))) {
+						bestTranslator = elTranslator;
+					}
+				}
+			}
+
+			if(null != bestTranslator) {
+				try {
+					Object execExt = bestTranslator.createExecutableExtension("class"); //$NON-NLS-1$
+					if (execExt instanceof IJSPELTranslator) {
+						return fELTranslator = (IJSPELTranslator)execExt;
+					} 
+				} catch (CoreException e) {
+					Logger.logException(e);
+				}
+			}
 		}
+		return fELTranslator;
 	}
 
 	/**
@@ -1299,7 +1397,7 @@
 					translateDeclarationString(embeddedContainer.getText(content), embeddedContainer, contentStart, content.getLength());
 				} else if (type == DOMJSPRegionContexts.JSP_EL_OPEN) {
 					fLastJSPType = EXPRESSION;
-					translateEL(embeddedContainer.getText(content), fCurrentNode, contentStart, content.getLength());
+					translateEL(embeddedContainer.getText(content), embeddedContainer.getText(delim), fCurrentNode, contentStart, content.getLength());
 				}
 
 				// calculate relative offset in buffer
@@ -1703,8 +1801,11 @@
 		boolean isUseBean = false;
 		for (int i = 0; i < regions.size(); i++) {
 			r = regions.get(i);
-			if (r.getType() == DOMRegionContext.XML_TAG_NAME && jspReferenceRegion.getText(r).equals("jsp:useBean")) { //$NON-NLS-1$
-				isUseBean = true;
+			if(r.getType() == DOMRegionContext.XML_TAG_NAME) {
+				if (r.getTextLength() == 11 && jspReferenceRegion.getText(r).equals("jsp:useBean")) { //$NON-NLS-1$
+					isUseBean = true;
+				}
+				// break no matter what if you hit tagname
 				break;
 			}
 		}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java
index 665e09f..462ae6f 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGenerator.java
@@ -13,7 +13,9 @@
 package org.eclipse.jst.jsp.core.internal.java.jspel;
 
 import java.util.Map;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslator;
+
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 
 /**
@@ -36,8 +38,8 @@
      * @param contentStart 
      * @param contentLength 
      */
-    public void generate(ASTExpression root, StringBuffer result, Map codeMap, JSPTranslator translator, ITextRegionCollection jspReferenceRegion, int contentStart, int contentLength) {
-		ELGeneratorVisitor visitor = new ELGeneratorVisitor(result, codeMap, translator, jspReferenceRegion, contentStart);
+    public void generate(ASTExpression root, IStructuredDocumentRegion currentNode, StringBuffer result, Map codeMap, IStructuredDocument document, ITextRegionCollection jspReferenceRegion, int contentStart, int contentLength) {
+		ELGeneratorVisitor visitor = new ELGeneratorVisitor(result, currentNode, codeMap, document, jspReferenceRegion, contentStart);
 		root.jjtAccept(visitor, null);
     }
 }
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
index dfd3cd2..8c92898 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/ELGeneratorVisitor.java
@@ -22,7 +22,8 @@
 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.JSPTranslator;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
 import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionCollection;
 
 public class ELGeneratorVisitor implements JSPELParserVisitor {
@@ -68,7 +69,7 @@
 	private Map fCodeMap;
 	private int fOffsetInUserCode;
 	private int methodCounter = 0;
-	private JSPTranslator fTranslator = null;
+	private IStructuredDocument fDocument = null;
 	private int fContentStart;
 	private static Map fOperatorMap;
 	
@@ -76,6 +77,8 @@
 	// contains a reference to a variable for which information is only available at runtime.
 	private boolean fCanGenerate = true;
 
+	private IStructuredDocumentRegion fCurrentNode;
+
 	/**
 	 * Tranlsation of XML-style operators to java
 	 */
@@ -98,13 +101,14 @@
 	 * @param jspReferenceRegion
 	 * @param contentStart
 	 */
-	public ELGeneratorVisitor(StringBuffer result, Map codeMap, JSPTranslator translator, ITextRegionCollection jspReferenceRegion, int contentStart)
+	public ELGeneratorVisitor(StringBuffer result, IStructuredDocumentRegion currentNode, Map codeMap, IStructuredDocument document, ITextRegionCollection jspReferenceRegion, int contentStart)
 	{
 		fResult = result;
 		fCodeMap = codeMap;
 		fOffsetInUserCode = result.length();
 		fContentStart = contentStart;
-		fTranslator = translator;
+		fDocument = document;
+		fCurrentNode = currentNode;
 	}
 
 	/**
@@ -163,14 +167,14 @@
 	 * @return
 	 */
 	protected String genFunction(String fullFunctionName) {
-		TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(fTranslator.getStructuredDocument());
+		TLDCMDocumentManager docMgr = TaglibController.getTLDCMDocumentManager(fDocument);
 		int colonIndex = fullFunctionName.indexOf(':');
 		String prefix = fullFunctionName.substring(0, colonIndex);
 		String functionName = fullFunctionName.substring(colonIndex + 1);
 		if (docMgr == null)
 			return null;
 		
-		Iterator taglibs = docMgr.getCMDocumentTrackers(fTranslator.getCurrentNode().getStartOffset()).iterator();
+		Iterator taglibs = docMgr.getCMDocumentTrackers(fCurrentNode.getStartOffset()).iterator();
 		while (taglibs.hasNext()) {
 			TaglibTracker tracker = (TaglibTracker)taglibs.next();
 			if(tracker.getPrefix().equals(prefix)) {
@@ -345,6 +349,15 @@
 	 * Value node
 	 */
 	public Object visit(ASTValue node, Object data) {
+		if(node.jjtGetNumChildren() >= 2) {
+			if(node.jjtGetChild(0) instanceof ASTValuePrefix && node.jjtGetChild(1) instanceof ASTValueSuffix) {
+				ASTValuePrefix prefix = (ASTValuePrefix) node.jjtGetChild(0);
+				ASTValueSuffix suffix = (ASTValueSuffix) node.jjtGetChild(1);
+				if(prefix.firstToken.image.equals("pageContext") && suffix.getPropertyNameToken().image.equals("request")) {
+					append("((HTTPServletRequest)");
+				}
+			}
+		}
 		return node.childrenAccept(this, data);	
 	}
 
@@ -388,8 +401,21 @@
 		} else if(null != node.getPropertyNameToken()) {
 			Token suffix = node.getPropertyNameToken();
 			String ucaseName = suffix.image.substring(0, 1).toUpperCase() + suffix.image.substring(1, suffix.image.length()); 
+
+			// This is a special case.  Note that the type system, no matter how much type information
+			// we would have wouldn't give us the correct result.  We're looking for "pageContext.request" 
+			// here and will add a downcast to (HTTPServletRequest)
+			
 			append(node.firstToken);
 			append("get" + ucaseName + "()", suffix); //$NON-NLS-1$ //$NON-NLS-2$
+			
+			SimpleNode parent = (SimpleNode) node.jjtGetParent();
+			if(suffix.image.equals("request") && parent instanceof ASTValue && //$NON-NLS-1$
+					parent.jjtGetParent() instanceof ASTUnaryExpression && parent.firstToken.image.equals("pageContext")) { //$NON-NLS-1$
+				append(")");
+			} 
+
+
 		} else {
 			append(node.firstToken);
 		}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java
index 50fe376..74a473d 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELParserTokenManager.java
@@ -372,7 +372,7 @@
       if (curChar < 64)
       {
          long l = 1L << curChar;
-         MatchLoop: do
+         do
          {
             switch(jjstateSet[--i])
             {
@@ -541,7 +541,7 @@
       else if (curChar < 128)
       {
          long l = 1L << (curChar & 077);
-         MatchLoop: do
+         do
          {
             switch(jjstateSet[--i])
             {
@@ -621,7 +621,7 @@
          long l1 = 1L << (hiByte & 077);
          int i2 = (curChar & 0xff) >> 6;
          long l2 = 1L << (curChar & 077);
-         MatchLoop: do
+         do
          {
             switch(jjstateSet[--i])
             {
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELTranslator.java
new file mode 100644
index 0000000..8ba5eb3
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/java/jspel/JSPELTranslator.java
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2005 BEA Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     BEA Systems - initial implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.core.internal.java.jspel;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.jface.text.Position;
+import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
+import org.eclipse.jst.jsp.core.jspel.ELProblem;
+import org.eclipse.jst.jsp.core.jspel.IJSPELTranslator;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+
+	
+public class JSPELTranslator implements IJSPELTranslator {
+	/**
+	 * JSP Expression Language Parser.
+	 */
+	private JSPELParser elParser = null;
+	
+	public List translateEL(String elText, String delim,
+			IStructuredDocumentRegion currentNode, int contentStart,
+			int contentLength, StringBuffer fUserELExpressions,
+			HashMap fUserELRanges, IStructuredDocument document) {
+		
+		ArrayList elProblems = new ArrayList();
+		
+		try {
+			synchronized(this) {
+				if(null == elParser) {
+					elParser = JSPELParser.createParser(elText);
+				} else {
+					elParser.ReInit(elText);
+				}
+			
+				ASTExpression expression = elParser.Expression();
+				ELGenerator gen = new ELGenerator();
+				gen.generate(expression, currentNode, fUserELExpressions, fUserELRanges, document, currentNode, contentStart, contentLength);
+			}
+		} catch (ParseException e) {
+			Token curTok = e.currentToken;
+			int problemStartOffset;
+			int problemEndOffset;
+			Position pos = null;
+			problemStartOffset =  contentStart + curTok.beginColumn;
+			problemEndOffset = contentStart + curTok.endColumn;
+			
+			pos = new Position(problemStartOffset, problemEndOffset - problemStartOffset + 1);
+			elProblems.add(new ELProblem(pos, e.getLocalizedMessage()));
+		} catch (TokenMgrError te) {
+			Position pos = new Position(contentStart, contentLength);
+			elProblems.add(new ELProblem(pos, JSPCoreMessages.JSPEL_Token));
+		}
+		return elProblems;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
index 5b6e839..2e1ffb7 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/internal/validation/JSPValidator.java
@@ -20,24 +20,18 @@
 import org.eclipse.core.runtime.content.IContentDescription;
 import org.eclipse.core.runtime.content.IContentType;
 import org.eclipse.jdt.core.compiler.IProblem;
-import org.eclipse.jface.text.IDocument;
 import org.eclipse.jst.jsp.core.internal.JSPCoreMessages;
 import org.eclipse.jst.jsp.core.internal.JSPCorePlugin;
 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.java.JSPTranslationAdapterFactory;
-import org.eclipse.jst.jsp.core.internal.java.JSPTranslationExtension;
 import org.eclipse.jst.jsp.core.internal.preferences.JSPCorePreferenceNames;
 import org.eclipse.jst.jsp.core.internal.provisional.contenttype.ContentTypeIdForJSP;
-import org.eclipse.jst.jsp.core.internal.regions.DOMJSPRegionContexts;
 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.validation.internal.core.Message;
 import org.eclipse.wst.validation.internal.core.ValidationException;
 import org.eclipse.wst.validation.internal.operations.IWorkbenchContext;
@@ -47,7 +41,6 @@
 import org.eclipse.wst.validation.internal.provisional.core.IValidator;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
 import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 
 public class JSPValidator implements IValidator {
 
@@ -272,7 +265,6 @@
 		int sourceEnd = translation.getJspOffset(problem.getSourceEnd());
 		if (sourceStart == -1)
 			return null;
-		
 		// line number for marker starts @ 1
 		// line number from document starts @ 0
 		int lineNo = structuredDoc.getLineOfOffset(sourceStart) + 1;
@@ -285,94 +277,10 @@
 		m.setOffset(sourceStart);
 		m.setLength(sourceEnd - sourceStart + 1);
 
-		// need additional adjustment for problems from
-		// indirect (included) files
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=119633
-		if(translation.isIndirect(problem.getSourceStart())) {
-			adjustIndirectPosition(m, translation);
-		}
-		
 		return m;
 	}
 
 	/**
-	 * Assumed the message offset is an indirect position.
-	 * In other words, an error from an included file.
-	 * 
-	 * @param m
-	 * @param translation
-	 */
-	private void adjustIndirectPosition(IMessage m, JSPTranslation translation) {
-		
-		if(!(translation instanceof JSPTranslationExtension))
-			return;
-		
-		IDocument jspDoc = ((JSPTranslationExtension)translation).getJspDocument();
-		if(!(jspDoc instanceof IStructuredDocument))
-			return;
-		
-		IStructuredDocument sDoc = (IStructuredDocument)jspDoc;
-		IStructuredDocumentRegion[] regions = sDoc.getStructuredDocumentRegions(0, m.getOffset() + m.getLength());
-		// iterate backwards until you hit the include directive
-		for(int i=regions.length-1; i>=0; i--) {
-			
-			IStructuredDocumentRegion region = regions[i];
-			if(region.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-				if(getDirectiveName(region).equals("include")) { //$NON-NLS-1$
-					ITextRegion fileValueRegion = getAttributeValueRegion(region, "file"); //$NON-NLS-1$
-					m.setOffset(region.getStartOffset(fileValueRegion));
-					m.setLength(fileValueRegion.getTextLength());
-					break;
-				}
-			}
-		}
-	}
-	
-	/**
-	 * 
-	 * @param sdr
-	 * @return the jsp directive name
-	 */
-	private String getDirectiveName(IStructuredDocumentRegion sdr) {
-		String name = "";
-		ITextRegionList subRegions = sdr.getRegions();
-		for (int j = 0; j < subRegions.size(); j++) {
-			ITextRegion subRegion = subRegions.get(j);
-			if(subRegion.getType() == DOMJSPRegionContexts.JSP_DIRECTIVE_NAME) {
-				name = sdr.getText(subRegion);
-				break;
-			}
-		}
-		return name;
-	}
-	
-	/**
-	 * 
-	 * @param sdr
-	 * @param attrName
-	 * @return the ITextRegion for the attribute value of the given attribute name
-	 */
-	private ITextRegion getAttributeValueRegion(IStructuredDocumentRegion sdr, String attrName) {
-		ITextRegion valueRegion = null;
-		ITextRegionList subRegions = sdr.getRegions();
-		for (int i = 0; i < subRegions.size(); i++) {
-			ITextRegion subRegion = subRegions.get(i);
-			if(subRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME && sdr.getText(subRegion).equals(attrName)) {
-				
-				for(int j=i+1; i<subRegions.size(); j++) {
-					subRegion = subRegions.get(j);
-					if(subRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
-						valueRegion = subRegion;
-						break;
-					}
-				}
-				break;
-			}
-		}
-		return valueRegion;
-	}
-
-	/**
 	 * When loading model from a file, you need to explicitly add adapter
 	 * factory.
 	 * 
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
new file mode 100644
index 0000000..599903d
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/ELProblem.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2005 BEA Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     BEA Systems - initial implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.core.jspel;
+
+import org.eclipse.jface.text.Position;
+
+public class ELProblem {
+	private Position fPos;
+	private String fMessage;
+	
+	public ELProblem(Position pos, String message)	{
+		fPos = pos;
+		fMessage = message;
+	}
+	
+	public String getMessage() {
+		return fMessage;
+	}
+	
+
+	public Position getPosition() {
+		return fPos;
+	}
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/IJSPELTranslator.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/IJSPELTranslator.java
new file mode 100644
index 0000000..17562e3
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/jspel/IJSPELTranslator.java
@@ -0,0 +1,48 @@
+/*******************************************************************************
+ * Copyright (c) 2005 BEA Systems and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     BEA Systems - initial implementation
+ *     
+ *******************************************************************************/
+
+package org.eclipse.jst.jsp.core.jspel;
+
+import java.util.List;
+import java.util.HashMap;
+
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
+import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
+
+public interface IJSPELTranslator {
+
+	/**
+	 * To override the EL translation, please see the extension point 
+	 * org.eclipse.jst.jsp.core.eltranslator.
+	 * 
+	 * @param elText  The text to be translated.
+	 * @param delim	The starting delimiter
+	 * @param currentNode The current IStructuredDocumentRegion
+	 * @param contentStart The starting offset of the EL to be translated
+	 * @param contentLength The length of the EL content to be translated
+	 * @param fUserELExpressions A string buffer to which generated code can be appended.
+	 *		The text appended here will be inserted into the generated class at the top level 
+	 *		not at the point in the JSP translation where the EL was found. 
+	 * 
+	 * @param fUserELRanges  Map of location ranges from JSP EL offsets to generated Java code.
+	 * @param document The structured document.
+	 * @return A list of ELProblems that describes any syntactic issues found.
+	 */
+	public List translateEL(String elText,
+			String delim,
+			IStructuredDocumentRegion currentNode, 
+			int contentStart,
+			int contentLength,
+			StringBuffer userELExpressions,
+			HashMap userELRanges,
+			IStructuredDocument document);
+}
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
index 4500d62..04bd47b 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
@@ -11,15 +11,19 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.core.taglib;
 
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.net.MalformedURLException;
 import java.net.URL;
+import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Hashtable;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Locale;
 import java.util.Stack;
 
 import org.eclipse.core.filebuffers.FileBuffers;
@@ -49,6 +53,8 @@
 import org.eclipse.jst.jsp.core.internal.util.DocumentProvider;
 import org.eclipse.wst.common.uriresolver.internal.util.URIHelper;
 import org.eclipse.wst.sse.core.internal.util.JarUtilities;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog;
 import org.w3c.dom.Document;
 import org.w3c.dom.EntityReference;
 import org.w3c.dom.Node;
@@ -446,15 +452,107 @@
 	void clear() {
 	}
 
+	private ITaglibRecord createCatalogRecord(String urlString) {
+		ITaglibRecord record = null;
+		if (urlString.toLowerCase(Locale.US).endsWith((".jar")) && urlString.startsWith("file:")) {
+			String fileLocation = null;
+			try {
+				URL url = new URL(urlString);
+				fileLocation = url.getFile();
+			}
+			catch (MalformedURLException e) {
+				// not worth reporting
+			}
+			if (fileLocation != null) {
+				JarRecord jarRecord = createJARRecord(fileLocation);
+				String[] entries = JarUtilities.getEntryNames(fileLocation);
+				for (int jEntry = 0; jEntry < entries.length; jEntry++) {
+					if (entries[jEntry].endsWith(".tld")) { //$NON-NLS-1$
+						if (entries[jEntry].equals(JarUtilities.JSP11_TAGLIB)) {
+							jarRecord.has11TLD = true;
+							InputStream contents = JarUtilities.getInputStream(fileLocation, entries[jEntry]);
+							if (contents != null) {
+								TaglibInfo info = extractInfo(fileLocation, contents);
+								jarRecord.info = info;
+							}
+							try {
+								contents.close();
+							}
+							catch (IOException e) {
+							}
+						}
+					}
+				}
+				if (jarRecord.has11TLD) {
+					if (_debugIndexCreation)
+						Logger.log(Logger.INFO_DEBUG, "created catalog record for " + urlString + "@" + jarRecord.getLocation()); //$NON-NLS-1$ //$NON-NLS-2$
+					record = jarRecord;
+				}
+
+			}
+		}
+		else {
+			URL url = null;
+			ByteArrayInputStream cachedContents = null;
+			InputStream tldStream = null;
+			try {
+				url = new URL(urlString);
+				URLConnection connection = url.openConnection();
+				connection.setDefaultUseCaches(false);
+				tldStream = connection.getInputStream();
+			}
+			catch (Exception e1) {
+				Logger.logException(e1);
+			}
+
+			int c;
+			ByteArrayOutputStream buffer = new ByteArrayOutputStream();
+			// array dim restriction?
+			byte bytes[] = new byte[2048];
+			try {
+				while ((c = tldStream.read(bytes)) >= 0) {
+					buffer.write(bytes, 0, c);
+				}
+				cachedContents = new ByteArrayInputStream(buffer.toByteArray());
+			}
+			catch (IOException ioe) {
+				// no cleanup can be done
+			}
+			finally {
+				try {
+					tldStream.close();
+				}
+				catch (IOException e) {
+				}
+			}
+
+			URLRecord urlRecord = null;
+			TaglibInfo info = extractInfo(urlString, cachedContents);
+			if (info != null) {
+				urlRecord = new URLRecord();
+				urlRecord.info = info;
+				urlRecord.baseLocation = urlString;
+				urlRecord.url = url; //$NON-NLS-1$ //$NON-NLS-2$
+			}
+			try {
+				cachedContents.close();
+			}
+			catch (IOException e) {
+			}
+			record = urlRecord;
+		}
+		return record;
+	}
+
 	/**
 	 * @param resource
 	 * @return
 	 */
-	private ITaglibRecord createJARRecord(IResource jar) {
+	private JarRecord createJARRecord(IResource jar) {
 		return createJARRecord(jar.getLocation().toString());
 	}
 
-	private ITaglibRecord createJARRecord(String fileLocation) {
+	private JarRecord createJARRecord(String fileLocation) {
 		JarRecord record = new JarRecord();
 		record.location = new Path(fileLocation);
 		record.urlRecords = new ArrayList(0);
@@ -930,6 +1028,32 @@
 			record = (ITaglibRecord) fClasspathReferences.get(reference);
 		}
 
+		// Check the XML Catalog
+		if (record == null) {
+			ICatalog catalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
+			if (catalog != null) {
+				String resolvedString = null;
+				try {
+					// Check as system reference first
+					resolvedString = catalog.resolveSystem(reference);
+					// Check as URI
+					if (resolvedString == null || resolvedString.trim().length() == 0) {
+						resolvedString = catalog.resolveURI(reference);
+					}
+					// Check as public ID
+					if (resolvedString == null || resolvedString.trim().length() == 0) {
+						resolvedString = catalog.resolvePublic(reference, basePath);
+					}
+				}
+				catch (Exception e) {
+					Logger.logException(e);
+				}
+				if (resolvedString != null && resolvedString.trim().length() > 0) {
+					record = createCatalogRecord(resolvedString);
+				}
+			}
+		}
+
 		// If no records were found and no local-root applies, check ALL of
 		// the web.xml files as a fallback
 		if (record == null && fProject.getFullPath().toString().equals(getLocalRoot(basePath))) {
@@ -945,7 +1069,7 @@
 
 	void updateClasspathLibrary(String libraryLocation, int deltaKind) {
 		String[] entries = JarUtilities.getEntryNames(libraryLocation);
-		JarRecord libraryRecord = (JarRecord) createJARRecord(libraryLocation);
+		JarRecord libraryRecord = createJARRecord(libraryLocation);
 		fClasspathJars.put(libraryLocation, libraryRecord);
 		for (int i = 0; i < entries.length; i++) {
 			if (entries[i].equals(JarUtilities.JSP11_TAGLIB)) {
@@ -988,7 +1112,7 @@
 			Logger.log(Logger.INFO_DEBUG, "creating records for JAR " + jar.getFullPath()); //$NON-NLS-1$
 		String jarLocationString = jar.getLocation().toString();
 		String[] entries = JarUtilities.getEntryNames(jar);
-		JarRecord jarRecord = (JarRecord) createJARRecord(jar);
+		JarRecord jarRecord = createJARRecord(jar);
 		fJARReferences.put(jar.getFullPath().toString(), jarRecord);
 		for (int i = 0; i < entries.length; i++) {
 			if (entries[i].endsWith(".tld")) { //$NON-NLS-1$
@@ -1068,6 +1192,7 @@
 			DocumentProvider provider = new DocumentProvider();
 			provider.setInputStream(webxmlContents);
 			provider.setValidating(false);
+			provider.setRootElementName("web-app"); //$NON-NLS-1$
 			provider.setBaseReference(webxml.getParent().getLocation().toString());
 			document = provider.getDocument();
 		}
@@ -1104,18 +1229,53 @@
 				path = new Path(URIHelper.normalize(taglibLocation, webxml.getFullPath().toString(), getLocalRoot(webxml.getLocation().toString())));
 			}
 			if (path.segmentCount() > 1) {
-				IFile tldResource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
-				if (tldResource.isAccessible()) {
-					TLDRecord record = createTLDRecord(tldResource);
-					// the stored URI should reflect the web.xml's value
-					record.info.uri = taglibUri;
+				IFile resource = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+				if (resource.isAccessible()) {
+					ITaglibRecord record = null;
+					/*
+					 * https://bugs.eclipse.org/bugs/show_bug.cgi?id=125960
+					 * 
+					 * Also support mappings to .jar files
+					 */
+					if (resource.getFileExtension().equalsIgnoreCase(("jar"))) {
+						JarRecord jarRecord = createJARRecord(resource);
+						String[] entries = JarUtilities.getEntryNames(resource);
+						for (int jEntry = 0; jEntry < entries.length; jEntry++) {
+							if (entries[jEntry].endsWith(".tld")) { //$NON-NLS-1$
+								if (entries[jEntry].equals(JarUtilities.JSP11_TAGLIB)) {
+									jarRecord.has11TLD = true;
+									InputStream contents = JarUtilities.getInputStream(resource, entries[jEntry]);
+									if (contents != null) {
+										TaglibInfo info = extractInfo(resource.getLocation().toString(), contents);
+										jarRecord.info = info;
+									}
+									try {
+										contents.close();
+									}
+									catch (IOException e) {
+									}
+								}
+							}
+						}
+						record = jarRecord;
+						// the stored URI should reflect the web.xml's value
+						jarRecord.info.uri = taglibUri;
+						if (_debugIndexCreation)
+							Logger.log(Logger.INFO_DEBUG, "created web.xml record for " + taglibUri + "@" + jarRecord.getLocation()); //$NON-NLS-1$ //$NON-NLS-2$
+					}
+					else {
+						TLDRecord tldRecord = createTLDRecord(resource);
+						record = tldRecord;
+						// the stored URI should reflect the web.xml's value
+						tldRecord.info.uri = taglibUri;
+						if (_debugIndexCreation)
+							Logger.log(Logger.INFO_DEBUG, "created web.xml record for " + taglibUri + "@" + tldRecord.getPath()); //$NON-NLS-1$ //$NON-NLS-2$
+					}
 					webxmlRecord.tldRecords.add(record);
 					getImplicitReferences(webxml.getFullPath().toString()).put(taglibUri, record);
-					if (_debugIndexCreation)
-						Logger.log(Logger.INFO_DEBUG, "created web.xml record for " + taglibUri + "@" + record.getPath()); //$NON-NLS-1$ //$NON-NLS-2$
 					TaglibIndex.fireTaglibRecordEvent(new TaglibRecordEvent(record, deltaKind));
 				}
 			}
 		}
 	}
-}
+}
\ No newline at end of file
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
index 74c8c36..57ea525 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/TaglibIndex.java
@@ -312,8 +312,7 @@
 	 * @deprecated - is not correct in flexible projects
 	 * @param path -
 	 *            a path under the web-app root
-	 * @return the IPath considered to be the web-app's root for the given
-	 *         path
+	 * @return
 	 */
 	public static IPath getContextRoot(IPath path) {
 		return _instance.internalGetContextRoot(path);
diff --git a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
index 8c6aa0a..879c78f 100644
--- a/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.jst.jsp.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jst.jsp.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.jst.jsp.ui.internal.JSPUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
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
index de14905..39858f5 100644
--- 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
@@ -866,48 +866,8 @@
 				jspResults = merge(jspResults, htmlResults);
 			}
 		}
-
-		// https://bugs.eclipse.org/bugs/show_bug.cgi?id=86656
-		if(partitionType == IJSPPartitionTypes.JSP_DIRECTIVE) {
-			ICompletionProposal[] importProposals = getImportProposals(viewer, documentPosition);
-			if(importProposals.length > 0)
-				jspResults = merge(jspResults, importProposals);			
-		}
 		return jspResults;
 	}
-	
-	private ICompletionProposal[] getImportProposals(ITextViewer viewer, int documentPosition) {
-		List importProposals = new ArrayList();
-		ICompletionProposal[] proposals =  getJSPJavaCompletionProposals(viewer, documentPosition);
-		for (int i = 0; i < proposals.length; i++) {
-			if(proposals[i] instanceof JSPCompletionProposal) {
-				
-				ICompletionProposal importProposal = adjustImportProposal((JSPCompletionProposal)proposals[i]);
-				importProposals.add(importProposal);
-			}
-		}
-		return (ICompletionProposal[])importProposals.toArray(new ICompletionProposal[importProposals.size()]);
-	}
-
-	
-	private ICompletionProposal adjustImportProposal(JSPCompletionProposal importProposal) {
-		
-		// just need to remove the ";"
-		// and adjust offsets for the change
-		String newReplace = importProposal.getReplacementString().replaceAll(";", ""); 
-		importProposal.setReplacementString(newReplace);
-		
-		String newDisplay = importProposal.getDisplayString().replaceAll(";", "");
-		importProposal.setDisplayString(newDisplay);
-		
-		int newReplacementLength = importProposal.getReplacementLength()-1;
-		importProposal.setReplacementLength(newReplacementLength);
-		
-		int newCursorPosition = importProposal.getCursorPosition() - 1;
-		importProposal.setCursorPosition(newCursorPosition);
-		
-		return importProposal;
-	}
 
 	/**
 	 * Adds 2 arrays of ICompletionProposals and sorts them with a
@@ -996,7 +956,7 @@
 		JSPJavaContentAssistProcessor p = (JSPJavaContentAssistProcessor) fPartitionToProcessorMap.get(IJSPPartitionTypes.JSP_DEFAULT);
 		return p.computeCompletionProposals(viewer, documentPosition);
 	}
-	
+
 	/**
 	 * @param viewer
 	 * @param documentPosition
@@ -1185,7 +1145,8 @@
 			}
 		}
 		
-		addTemplates(request, TemplateContextTypeIdsJSP.ALL);
+		// bug115927 use original document position for all/any region templates
+		addTemplates(request, TemplateContextTypeIdsJSP.ALL, documentPosition);
 		return request;
 	}
 
@@ -1203,6 +1164,17 @@
 	 * @param context
 	 */
 	private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
+		addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
+	}
+	
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 * @param startOffset
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
 		if (contentAssistRequest == null)
 			return;
 		
@@ -1214,7 +1186,7 @@
 
 			if (getTemplateCompletionProcessor() != null) {
 				getTemplateCompletionProcessor().setContextType(context);
-				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, contentAssistRequest.getReplacementBeginPosition());
+				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
 				for (int i = 0; i < proposals.length; ++i) {
 					if (useProposalList)
 						contentAssistRequest.addProposal(proposals[i]);
@@ -1224,8 +1196,7 @@
 			}
 		}
 	}
-
-
+	
 	protected void addEntityProposals(ContentAssistRequest contentAssistRequest, int documentPosition, ITextRegion completionRegion, IDOMNode treeNode) {
 		// ignore
 	}
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
index f3214dc..e835787 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,14 +10,24 @@
  *******************************************************************************/
 package org.eclipse.jst.jsp.ui.internal.contentassist;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.templates.ContextTypeRegistry;
 import org.eclipse.jface.text.templates.Template;
 import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
 import org.eclipse.jface.text.templates.TemplateContext;
 import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateProposal;
 import org.eclipse.jface.text.templates.persistence.TemplateStore;
 import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
 import org.eclipse.jst.jsp.ui.internal.editor.JSPEditorPluginImageHelper;
@@ -30,12 +40,90 @@
  * 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 static final class ProposalComparator implements Comparator {
+		public int compare(Object o1, Object o2) {
+			return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
+		}
+	}
+
+	private static final Comparator fgProposalComparator = new ProposalComparator();
 	private String fContextTypeId = null;
 
+	/*
+	 * Copied from super class except instead of calling createContext(viewer,
+	 * region) call createContext(viewer, region, offset) instead
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+
+		ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+
+		// adjust offset to end of normalized selection
+		if (selection.getOffset() == offset)
+			offset = selection.getOffset() + selection.getLength();
+
+		String prefix = extractPrefix(viewer, offset);
+		Region region = new Region(offset - prefix.length(), prefix.length());
+		TemplateContext context = createContext(viewer, region, offset);
+		if (context == null)
+			return new ICompletionProposal[0];
+
+		context.setVariable("selection", selection.getText()); // name of the
+																// selection
+																// variables
+																// {line,
+																// word}_selection
+																// //$NON-NLS-1$
+
+		Template[] templates = getTemplates(context.getContextType().getId());
+
+		List matches = new ArrayList();
+		for (int i = 0; i < templates.length; i++) {
+			Template template = templates[i];
+			try {
+				context.getContextType().validate(template.getPattern());
+			}
+			catch (TemplateException e) {
+				continue;
+			}
+			if (template.matches(prefix, context.getContextType().getId()))
+				matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
+		}
+
+		Collections.sort(matches, fgProposalComparator);
+
+		return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
+	}
+
+	/**
+	 * Creates a concrete template context for the given region in the
+	 * document. This involves finding out which context type is valid at the
+	 * given location, and then creating a context of this type. The default
+	 * implementation returns a <code>SmartReplaceTemplateContext</code> for
+	 * the context type at the given location. This takes the offset at which
+	 * content assist was invoked into consideration.
+	 * 
+	 * @param viewer
+	 *            the viewer for which the context is created
+	 * @param region
+	 *            the region into <code>document</code> for which the
+	 *            context is created
+	 * @param offset
+	 *            the original offset where content assist was invoked
+	 * @return a template context that can handle template insertion at the
+	 *         given location, or <code>null</code>
+	 */
+	private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
+		// pretty much same code as super.createContext except create SmartReplaceTemplateContext
+		TemplateContextType contextType = getContextType(viewer, region);
+		if (contextType != null) {
+			IDocument document = viewer.getDocument();
+			return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
+		}
+		return null;
+	}
+	
 	protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
 		return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
 	}
diff --git a/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
new file mode 100644
index 0000000..1f4e9d1
--- /dev/null
+++ b/bundles/org.eclipse.jst.jsp.ui/src/org/eclipse/jst/jsp/ui/internal/contentassist/ReplaceNameTemplateContext.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jst.jsp.ui.internal.contentassist;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+
+/**
+ * Just like DocumentTemplateContext except if an insert offset is passed in,
+ * during evaluation, the "prefix" before the template will be checked to see
+ * if it matches the template name. If so, overwrite the template name.
+ * Otherwise, just insert the template at the insert offset location (by not
+ * overwriting the prefix text)
+ */
+public class ReplaceNameTemplateContext extends DocumentTemplateContext {
+	private int fInsertOffset = -1;
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length) {
+		this(type, document, new Position(offset, length));
+	}
+
+	/**
+	 * Creates a document template context. The supplied <code>Position</code>
+	 * will be queried to compute the <code>getStart</code> and
+	 * <code>getEnd</code> methods, which will therefore answer updated
+	 * position data if it is registered with the document.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param position
+	 *            the position describing the area of the document which forms
+	 *            the template context
+	 * @since 3.1
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, Position position) {
+		super(type, document, position);
+	}
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 * @param insertOffset
+	 *            the offset of the document region where insert was
+	 *            originally requested
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length, int insertOffset) {
+		this(type, document, new Position(offset, length));
+		fInsertOffset = insertOffset;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
+	 */
+	public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
+		TemplateBuffer buffer = super.evaluate(template);
+		if (buffer != null) {
+			if (fInsertOffset > -1 && fInsertOffset > getStart()) {
+				String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
+				if (!template.getName().startsWith(prefix)) {
+					// generate a new buffer that actually contains the
+					// text that was going to be overwritten
+					buffer = new TemplateBuffer(prefix + buffer.getString(), buffer.getVariables());
+				}
+			}
+		}
+		return buffer;
+	}
+}
diff --git a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
index 8d88eb9..b14badc 100644
--- a/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.css.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.css.core; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.css.core.internal.CSSCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
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
index de4a0bc..9c5c7ee 100644
--- 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
@@ -124,7 +124,7 @@
 	 */
 	public boolean match(Element element, String pseudoName) {
 		int nSelectors = getLength();
-		selectorListLoop : for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
+		for (int iSelector = 0; iSelector < nSelectors; iSelector++) {
 			// Check each Selector Lists
 			ICSSSelector selector = getSelector(iSelector);
 			if (selector.match(element, pseudoName))
diff --git a/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
index ccebc4a..06bc72a 100644
--- a/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.css.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.css.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.css.ui.internal.CSSUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
index adc2aa8..3984f31 100644
--- a/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.dtd.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtd.core; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.dtd.core.internal.DTDCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
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
index d9bc439..eae2d7b 100644
--- 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
@@ -662,6 +662,10 @@
 		// 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;
 	}
diff --git a/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
index 1d26844..3dc3da7 100644
--- a/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.dtd.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtd.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.dtd.ui.internal.DTDUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
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
index e015586..a0c83a3 100644
--- 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
@@ -1,4 +1,4 @@
-#Mon May 30 17:55:54 EDT 2005
+#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
@@ -11,7 +11,7 @@
 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.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
@@ -23,7 +23,7 @@
 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.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
diff --git a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
index 31b015e..e6b6b31 100644
--- a/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.html.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.html.core; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.html.core.internal.HTMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
index f4e6340..53d29b9 100644
--- a/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
+++ b/bundles/org.eclipse.wst.html.core/src/org/eclipse/wst/html/core/internal/contentmodel/AttributeCollection.java
@@ -45,9 +45,8 @@
 
 	/**
 	 * Create an attribute declaration.
-	 * 
-	 * @param attrName
-	 *            java.lang.String
+
+	 * @param attrName java.lang.String
 	 */
 	private HTMLAttrDeclImpl create(String attrName) {
 		HTMLAttrDeclImpl attr = null;
@@ -406,8 +405,7 @@
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_FRAME)) {
 			// (frame %TFrame; #IMPLIED)
-			// %TFrame; is
-			// (void|above|below|hsides|lhs|rhs|vsides|box|border).
+			// %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);
@@ -422,13 +420,13 @@
 			atype.setImpliedValue(CMDataType.IMPLIED_VALUE_DEFAULT, ATTR_VALUE_1);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_FRAMEBORDER, atype, CMAttributeDeclaration.OPTIONAL);
 
-			// <<D215684
+			//<<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
+			//D215684
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_HEADERS)) {
 			// (HEADERS IDREFS; #IMPLIED)
@@ -660,7 +658,7 @@
 
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_ONFOCUS)) {
-			// (onfocus %Script; #IMPLIED)
+			//	(onfocus %Script; #IMPLIED)
 			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.SCRIPT);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_ONFOCUS, atype, CMAttributeDeclaration.OPTIONAL);
 
@@ -916,8 +914,8 @@
 		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.
+			//		 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);
 
@@ -959,8 +957,8 @@
 
 		}
 		else if (attrName.equalsIgnoreCase(ATTR_NAME_TEXT)) {
-			// (text %Color; #IMPLIED)
-			atype = new HTMLCMDataTypeImpl(HTMLCMDataType.COLOR);
+			// (text CDATA #IMPLIED)
+			atype = new HTMLCMDataTypeImpl(CMDataType.CDATA);
 			attr = new HTMLAttrDeclImpl(ATTR_NAME_TEXT, atype, CMAttributeDeclaration.OPTIONAL);
 
 		}
@@ -1110,9 +1108,9 @@
 	}
 
 	/**
-	 * Get align attribute which has %CAlign; as values.. At this time
-	 * (4/19/2001), it is identical to %LAlign;.
-	 * 
+	 * 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)
@@ -1154,12 +1152,13 @@
 	}
 
 	/**
-	 * 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>
+	 * 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);
@@ -1172,8 +1171,8 @@
 	}
 
 	/**
-	 * Get %attrs; declarations. %attrs; consists of %coreattrs;, %i18n, and
-	 * %events;.
+	 * Get %attrs; declarations.
+	 * %attrs; consists of %coreattrs;, %i18n, and %events;.
 	 */
 	public void getAttrs(CMNamedNodeMapImpl declarations) {
 		// %coreattrs;
@@ -1196,9 +1195,11 @@
 	}
 
 	/**
-	 * Get %cellhalign; declarations. %cellhaligh; consists of: - (align
-	 * (left|center|right|justify|char) #IMPLIED) - (char %Character;
-	 * #IMPLIED) - (charoff %Length; #IMPLIED)
+	 * 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
@@ -1217,8 +1218,9 @@
 	}
 
 	/**
-	 * Get %cellvalign; declarations. %cellhaligh; is: - (valign
-	 * (top|middle|bottom|baseline) #IMPLIED)
+	 * Get %cellvalign; declarations.
+	 * %cellhaligh; is:
+	 *  - (valign (top|middle|bottom|baseline) #IMPLIED)
 	 */
 	public void getCellvalign(CMNamedNodeMapImpl declarations) {
 		HTMLAttributeDeclaration dec = getDeclaration(HTML40Namespace.ATTR_NAME_VALIGN);
@@ -1236,9 +1238,7 @@
 
 	/**
 	 * Get a global attribute declaration.
-	 * 
-	 * @param attrName
-	 *            java.lang.String
+	 * @param attrName java.lang.String
 	 */
 	public HTMLAttributeDeclaration getDeclaration(String attrName) {
 		CMNode cmnode = getNamedItem(attrName);
@@ -1254,9 +1254,7 @@
 
 	/**
 	 * Get declarations which are specified by names.
-	 * 
-	 * @param names
-	 *            java.util.Iterator
+	 * @param names java.util.Iterator
 	 */
 	public void getDeclarations(CMNamedNodeMapImpl declarations, Iterator names) {
 		while (names.hasNext()) {
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
index 8a4fc91..27fcc9b 100644
--- 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
@@ -28,7 +28,6 @@
 import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
 import org.w3c.dom.Attr;
 import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
 
 // nakamori_TODO: check and remove CSS formatting
 
@@ -59,14 +58,6 @@
 	/**
 	 */
 	private void formatEndTag(IDOMElement element, HTMLFormatContraints contraints) {
-		Node lastChild = element.getLastChild();
-		
-		if(lastChild != null && lastChild instanceof IDOMElement && lastChild.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
-			insertBreakAfter((IDOMElement)lastChild, contraints);
-			return;
-		}
-		
-		
 		IStructuredDocumentRegion endStructuredDocumentRegion = element.getEndStructuredDocumentRegion();
 		if (endStructuredDocumentRegion == null)
 			return;
@@ -126,12 +117,6 @@
 	/**
 	 */
 	private void formatStartTag(IDOMElement element, HTMLFormatContraints contraints) {
-		
-		if(element.getNodeName().equals("jsp:scriptlet")) { //$NON-NLS-1$
-			insertBreakBefore(element, contraints);
-			return;
-		}
-		
 		IStructuredDocumentRegion startStructuredDocumentRegion = element.getStartStructuredDocumentRegion();
 		if (startStructuredDocumentRegion == null)
 			return;
diff --git a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
index a8261d1..92311f0 100644
--- a/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.html.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.html.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.html.ui.internal.HTMLUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
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
index ff35669..f605ba6 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -119,9 +119,20 @@
 	 * @param context
 	 */
 	private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
+		addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
+	}
+	
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 * @param startOffset
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
 		if (contentAssistRequest == null)
 			return;
-
+		
 		// if already adding template proposals for a certain context type, do
 		// not add again
 		if (!fTemplateContexts.contains(context)) {
@@ -130,7 +141,7 @@
 
 			if (getTemplateCompletionProcessor() != null) {
 				getTemplateCompletionProcessor().setContextType(context);
-				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, contentAssistRequest.getReplacementBeginPosition());
+				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
 				for (int i = 0; i < proposals.length; ++i) {
 					if (useProposalList)
 						contentAssistRequest.addProposal(proposals[i]);
@@ -151,7 +162,8 @@
 
 	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);
+		// bug115927 use original document position for all/any region templates
+		addTemplates(request, TemplateContextTypeIdsHTML.ALL, documentPosition);
 		return request;
 	}
 
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
index cc01530..1013fab 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2004 IBM Corporation and others.
+ * Copyright (c) 2004, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -10,14 +10,24 @@
  *******************************************************************************/
 package org.eclipse.wst.html.ui.internal.contentassist;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.templates.ContextTypeRegistry;
 import org.eclipse.jface.text.templates.Template;
 import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
 import org.eclipse.jface.text.templates.TemplateContext;
 import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateProposal;
 import org.eclipse.jface.text.templates.persistence.TemplateStore;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.html.ui.internal.HTMLUIPlugin;
@@ -33,8 +43,88 @@
  * templates.
  */
 class HTMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
+	private static final class ProposalComparator implements Comparator {
+		public int compare(Object o1, Object o2) {
+			return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
+		}
+	}
+
+	private static final Comparator fgProposalComparator = new ProposalComparator();
 	private String fContextTypeId = null;
 
+	/*
+	 * Copied from super class except instead of calling createContext(viewer,
+	 * region) call createContext(viewer, region, offset) instead
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+
+		ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+
+		// adjust offset to end of normalized selection
+		if (selection.getOffset() == offset)
+			offset = selection.getOffset() + selection.getLength();
+
+		String prefix = extractPrefix(viewer, offset);
+		Region region = new Region(offset - prefix.length(), prefix.length());
+		TemplateContext context = createContext(viewer, region, offset);
+		if (context == null)
+			return new ICompletionProposal[0];
+
+		context.setVariable("selection", selection.getText()); // name of the
+																// selection
+																// variables
+																// {line,
+																// word}_selection
+																// //$NON-NLS-1$
+
+		Template[] templates = getTemplates(context.getContextType().getId());
+
+		List matches = new ArrayList();
+		for (int i = 0; i < templates.length; i++) {
+			Template template = templates[i];
+			try {
+				context.getContextType().validate(template.getPattern());
+			}
+			catch (TemplateException e) {
+				continue;
+			}
+			if (template.matches(prefix, context.getContextType().getId()))
+				matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
+		}
+
+		Collections.sort(matches, fgProposalComparator);
+
+		return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
+	}
+
+	/**
+	 * Creates a concrete template context for the given region in the
+	 * document. This involves finding out which context type is valid at the
+	 * given location, and then creating a context of this type. The default
+	 * implementation returns a <code>SmartReplaceTemplateContext</code> for
+	 * the context type at the given location. This takes the offset at which
+	 * content assist was invoked into consideration.
+	 * 
+	 * @param viewer
+	 *            the viewer for which the context is created
+	 * @param region
+	 *            the region into <code>document</code> for which the
+	 *            context is created
+	 * @param offset
+	 *            the original offset where content assist was invoked
+	 * @return a template context that can handle template insertion at the
+	 *         given location, or <code>null</code>
+	 */
+	private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
+		// pretty much same code as super.createContext except create SmartReplaceTemplateContext
+		TemplateContextType contextType = getContextType(viewer, region);
+		if (contextType != null) {
+			IDocument document = viewer.getDocument();
+			return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
+		}
+		return null;
+	}
+
 	protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
 		return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
 	}
diff --git a/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
new file mode 100644
index 0000000..eef8962
--- /dev/null
+++ b/bundles/org.eclipse.wst.html.ui/src/org/eclipse/wst/html/ui/internal/contentassist/ReplaceNameTemplateContext.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.html.ui.internal.contentassist;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+
+/**
+ * Just like DocumentTemplateContext except if an insert offset is passed in,
+ * during evaluation, the "prefix" before the template will be checked to see
+ * if it matches the template name. If so, overwrite the template name.
+ * Otherwise, just insert the template at the insert offset location (by not
+ * overwriting the prefix text)
+ */
+public class ReplaceNameTemplateContext extends DocumentTemplateContext {
+	private int fInsertOffset = -1;
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length) {
+		this(type, document, new Position(offset, length));
+	}
+
+	/**
+	 * Creates a document template context. The supplied <code>Position</code>
+	 * will be queried to compute the <code>getStart</code> and
+	 * <code>getEnd</code> methods, which will therefore answer updated
+	 * position data if it is registered with the document.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param position
+	 *            the position describing the area of the document which forms
+	 *            the template context
+	 * @since 3.1
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, Position position) {
+		super(type, document, position);
+	}
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 * @param insertOffset
+	 *            the offset of the document region where insert was
+	 *            originally requested
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length, int insertOffset) {
+		this(type, document, new Position(offset, length));
+		fInsertOffset = insertOffset;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
+	 */
+	public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
+		TemplateBuffer buffer = super.evaluate(template);
+		if (buffer != null) {
+			if (fInsertOffset > -1 && fInsertOffset > getStart()) {
+				String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
+				if (!template.getName().startsWith(prefix)) {
+					// generate a new buffer that actually contains the
+					// text that was going to be overwritten
+					buffer = new TemplateBuffer(prefix + buffer.getString(), buffer.getVariables());
+				}
+			}
+		}
+		return buffer;
+	}
+}
diff --git a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
index 9f9acc3..5be5741 100644
--- a/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.core; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.wst.sse.core.internal.SSECorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
index 32aa35a..7c0be57 100644
--- a/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.sse.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.sse.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.sse.ui.internal.SSEUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties b/bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java
similarity index 100%
rename from bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/messages.properties
rename to bundles/org.eclipse.wst.sse.ui/src/org/eclipse/wst/sse/ui/internal/StructuredTextEditor.java
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
index 9cf15b6..9872fb2 100644
--- 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
@@ -188,7 +188,7 @@
     public int getContextInformationPosition() {
         return getCursorPosition();
     }
-    
+
     public int getCursorPosition() {
         return fCursorPosition;
     }
@@ -197,10 +197,6 @@
         fCursorPosition = pos;
     }
 
-    public void setDisplayString(String newDisplayString) {
-    	fDisplayString = newDisplayString;
-    }
-    
     public String getDisplayString() {
         // return fProposal.getDisplayString();
         return fDisplayString;
@@ -215,9 +211,6 @@
         return fRelevance;
     }
 
-    public void setReplacementLength(int newReplacementLength) {
-        fReplacementLength = newReplacementLength;
-    }  
     public int getReplacementLength() {
         return fReplacementLength;
     }
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
index 06dc1e6..60adbff 100644
--- 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
@@ -246,6 +246,10 @@
 	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) {
@@ -281,6 +285,12 @@
 
 	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) {
@@ -626,13 +636,13 @@
 					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 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
@@ -646,6 +656,8 @@
 						adjust(eventStyles, -offset);
 					}
 
+					eventStyles = limitSize(eventStyles);
+					
 					// for debugging only
 					if (DEBUG) {
 						if (!valid(eventStyles, eventLineOffset, eventLineLength)) {
@@ -670,6 +682,50 @@
 	}
 
 	/**
+	 * 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.
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
index 1cd221a..9e80850 100644
--- 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
@@ -305,7 +305,7 @@
 				dr = createDirtyRegion(event.getOffset(), 0, DirtyRegion.INSERT);
 			}
 			else {
-				if(event.getText().equals("")) { //$NON-NLS-1$
+				if("".equals(event.getText())) { //$NON-NLS-1$
 					// it's a delete
 					dr =createDirtyRegion(event.getOffset(), event.getLength(), DirtyRegion.REMOVE);
 				}
diff --git a/bundles/org.eclipse.wst.xml.core/.classpath b/bundles/org.eclipse.wst.xml.core/.classpath
index 16b5963..9ca79ee 100644
--- a/bundles/org.eclipse.wst.xml.core/.classpath
+++ b/bundles/org.eclipse.wst.xml.core/.classpath
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
 	<classpathentry kind="src" path="src-contentmodel"/>
-	<classpathentry kind="src" path="src-search"/>
 	<classpathentry kind="src" path="src-validation"/>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="src-catalog"/>
diff --git a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
index 3d84530..e4488b8 100644
--- a/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.core; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.2.qualifier
 Bundle-Activator: org.eclipse.wst.xml.core.internal.XMLCorePlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
@@ -26,6 +26,7 @@
  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.emf2xml,
  org.eclipse.wst.xml.core.internal.encoding,
  org.eclipse.wst.xml.core.internal.modelhandler,
  org.eclipse.wst.xml.core.internal.modelquery,
@@ -48,15 +49,11 @@
  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.eclipse.wst.xml.core.internal.search,
- org.eclipse.wst.xml.core.internal.search.impl,
- org.eclipse.wst.xml.core.internal.search.quickscan, 
- org.eclipse.wst.xml.core.internal.search.matching,  
+ org.eclipse.wst.xml.core.internal.validation.eclipse,
+ org.eclipse.wst.xml.core.internal.validation.errorcustomization,
  org.w3c.dom,
  org.w3c.dom.ranges,
- org.w3c.dom.traversal,
- org.eclipse.wst.xml.core.internal.emf2xml
- 
+ org.w3c.dom.traversal
 Require-Bundle: org.apache.xerces;visibility:=reexport,
  org.eclipse.wst.sse.core,
  org.eclipse.core.resources,
@@ -69,6 +66,6 @@
  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,
- org.eclipse.wst.common.core
+ 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/plugin.properties b/bundles/org.eclipse.wst.xml.core/plugin.properties
index e1cdf41..837cda4 100644
--- a/bundles/org.eclipse.wst.xml.core/plugin.properties
+++ b/bundles/org.eclipse.wst.xml.core/plugin.properties
@@ -22,4 +22,5 @@
 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
+XMI_Content_Type=XMI
+XML_Validation_Error_Customizer.name=XML Validator Error Customizer Extension Point
\ 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
index d721dbe..4a8f4c4 100644
--- a/bundles/org.eclipse.wst.xml.core/plugin.xml
+++ b/bundles/org.eclipse.wst.xml.core/plugin.xml
@@ -2,6 +2,10 @@
 <?eclipse version="3.0"?>
 <plugin>
 
+   <!-- An extension for contributing a XML validation error customizer. -->
+   <extension-point id="errorCustomizer" name="%XML_Validation_Error_Customizer.name" schema="schema/errorCustomizer.exsd"/>
+
+
 	<extension point="org.eclipse.wst.sse.core.modelHandler">
 		<modelHandler
 			default="true"
diff --git a/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd b/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
new file mode 100644
index 0000000..608f190
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/schema/errorCustomizer.exsd
@@ -0,0 +1,123 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.xml.core">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.xml.core" id="errorCustomizer" name="XML Validation Error Customizer"/>
+      </appInfo>
+      <documentation>
+         The error customizer extension point allows a client to contribute an error customizer for a specific namespace. The error customizer can provide error messages that are more domain specific than the generic error messages provided by the underlying generic XML validator.
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+            <element ref="errorCustomizer" minOccurs="1" maxOccurs="unbounded"/>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  a fully qualified identifier of the target extension point
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  an optional identifier of the extension instance
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  an optional name of the extension instance
+               </documentation>
+               <appInfo>
+                  <meta.attribute translatable="true"/>
+               </appInfo>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="errorCustomizer">
+      <complexType>
+         <attribute name="namespace" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The namespace for which this error customizer will consider error customizations.
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="class" type="string" use="required">
+            <annotation>
+               <documentation>
+                  The class that implements &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         &lt;b&gt;This extension point is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.&lt;/b&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         The following is an example of an Error Customizer contribution:
+&lt;pre&gt;
+   &lt;extension
+         id=&quot;sampleErrorCustomizer&quot;
+         name=&quot;Sample Error Customizer&quot;
+         point=&quot;org.eclipse.wst.xml.core.errorCustomizer&quot;&gt;
+      &lt;errorCustomizer
+            namespace=&quot;http://sample.namespace&quot;
+            class=&quot;org.eclipse.wst.xml.core.SampleErrorCustomizer&quot;/&gt;
+   &lt;/extension&gt;
+&lt;/pre&gt;
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         The supplied class must implement &lt;code&gt;org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer&lt;/code&gt;.
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         Copyright (c) 2006 IBM Corporation and others.&lt;br&gt;
+All rights reserved. This program and the accompanying materials are made 
+available under the terms of the Eclipse Public License v1.0 which accompanies 
+this distribution, and is available at &lt;a
+href=&quot;http://www.eclipse.org/legal/epl-v10.html&quot;&gt;http://www.eclipse.org/legal/epl-v10.html&lt;/a&gt;
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/bundles/org.eclipse.wst.xml.core/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
index d7e6d05..e17cd65 100644
--- 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
@@ -47,6 +47,7 @@
 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 */
@@ -121,12 +122,14 @@
 				try {
 					xmlModelReverted = true;
 					resource.unload();
-				} finally {
+				}
+				finally {
 					if (getXMLModel() != null)
 						getXMLModel().releaseFromEdit();
 				}
 			}
-		} finally {
+		}
+		finally {
 			aboutToChangeNode = null;
 		}
 	}
@@ -148,7 +151,7 @@
 	}
 
 	public void modelDirtyStateChanged(IStructuredModel model, boolean isDirty) {
-		if (!isDirty && resource.isModified()) { //The XMLModel was saved
+		if (!isDirty && resource.isModified()) { // The XMLModel was saved
 			resource.setModified(false);
 			long stamp = WorkbenchResourceHelper.computeModificationStamp(resource);
 			WorkbenchResourceHelper.setSynhronizationStamp(resource, stamp);
@@ -156,21 +159,21 @@
 			IFile aFile = WorkbenchResourceHelper.getFile(resource);
 			synchronizer.preSave(aFile);
 		}
-		if (isDirty) 
+		if (isDirty)
 			resource.setModified(true);
 	}
 
 	public void modelResourceDeleted(IStructuredModel model) {
-		//Do nothing
+		// Do nothing
 	}
 
 	public void modelResourceMoved(IStructuredModel oldModel, IStructuredModel newModel) {
-		//Do nothing
+		// Do nothing
 	}
 
 	/**
-	 * This method is called just prior to being removed from the ResourceSet. Ensure that all
-	 * reference counts to the XMLModel are removed.
+	 * 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())
@@ -191,10 +194,11 @@
 		// Calling getModelManager() can result in a class cast exception that
 		// should
 		// be ignored.
-		//ModelManager mgr = null;
+		// ModelManager mgr = null;
 		try {
 			getModelManager();
-		} catch (ClassCastException exc) {
+		}
+		catch (ClassCastException exc) {
 			return;
 		}
 		if (xmlModel != null) {
@@ -214,7 +218,8 @@
 	}
 
 	/**
-	 * Insert the method's description here. Creation date: (9/7/2001 10:49:53 AM)
+	 * Insert the method's description here. Creation date: (9/7/2001 10:49:53
+	 * AM)
 	 */
 	public void registerAsModelStateListener() {
 		this.xmlModel.addModelStateListener(this);
@@ -242,7 +247,8 @@
 	/*
 	 * (non-Javadoc)
 	 * 
-	 * @see com.ibm.etools.emf2xml.Renderer#doSave(java.io.OutputStream, java.util.Map)
+	 * @see com.ibm.etools.emf2xml.Renderer#doSave(java.io.OutputStream,
+	 *      java.util.Map)
 	 */
 	public void doSave(OutputStream outputStream, Map options) throws IOException {
 
@@ -256,12 +262,14 @@
 			try {
 				synchronizer.preSave(aFile);
 				xmlModel.save(aFile);
-			} catch (CoreException ex) {
+			}
+			catch (CoreException ex) {
 				synchronizer.removeFromRecentlySavedList(aFile);
 				Logger.getLogger().logError(ex);
 			}
 			cacheSynchronizationStamp();
-		} finally {
+		}
+		finally {
 			isSaving = false;
 		}
 	}
@@ -287,7 +295,8 @@
 			IFile file = WorkbenchResourceHelper.getFile(getResource());
 			if (file != null) {
 				xmlModelId = getModelManager().calculateId(file);
-			} else {
+			}
+			else {
 				xmlModelId = resource.getURI() + Long.toString(System.currentTimeMillis());
 			}
 		}
@@ -347,15 +356,18 @@
 				}
 				file.create(is, true, null);
 				file.setLocal(true, 1, null);
-			} catch (CoreException e1) {
+			}
+			catch (CoreException e1) {
 				org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e1);
-			} finally {
+			}
+			finally {
 				if (null != is) {
 					is.close();
 				}
 			}
 			initializeXMLModel(file, true);
-		} catch (java.io.IOException ex) {
+		}
+		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);
 		}
@@ -378,7 +390,8 @@
 			}
 			setXMLModelId(getXMLModel().getId());
 			needsToCreateDOM = false;
-		} catch (CoreException e) {
+		}
+		catch (CoreException e) {
 			org.eclipse.jem.util.logger.proxy.Logger.getLogger().logError(e);
 			return null;
 		}
@@ -419,18 +432,74 @@
 		}
 	}
 
+
+	/**
+	 * @deprecated use batchModeStart and BatchModeEnd instead
+	 * even if you do not use batchModelStart/End, you still need to 
+	 * use the try/finally pattern documented there. 
+	 */
+
 	public void setBatchMode(boolean isBatch) {
+		
+		// This is some extra processing for clients to know they may be using incorrectly
 		if (isBatch) {
-			isBatchChanges = true;
-			getXMLModel().aboutToChangeModel();
-			setRootNodeAdapterNotificationEnabled(false);
+			if (isBatchChanges) {
+				org.eclipse.wst.xml.core.internal.Logger.log(org.eclipse.wst.xml.core.internal.Logger.INFO, "setBatch was set to true when it was already true. This can be an inidcation of invalid calling order");
+			}
+		}
+
+
+		if (isBatch) {
+			batchModeStart();
 		}
 		else {
-			getXMLModel().changedModel();
-			setRootNodeAdapterNotificationEnabled(true);
-			isBatchChanges = false;
+			batchModeEnd();
 		}
 	}
+
+	/**
+	 * batchModeStart and batchModeEnd is a pair that controls notifications, and tread access. 
+	 * They should always be called in a try/finally block.
+	 * 
+	 * setBatchModel begins the processing where notifications are not sent
+	 * out on each change, but saved up until the endBatchMode called.
+	 * 
+	 * This pair of calls can also, indirectly, "lock" the DOM Model to access
+	 * from only one thread, so it should not be locked for long periods of
+	 * time. That's also why it is important to have the endBatchMode in a
+	 * finally block to be sure it is always called, or the DOM will be left
+	 * in a locked, unusable, state and only shortly away from severere program error.
+	 * 
+	 * <pre><code>Example</code>
+	 * 
+	 * try { 
+	 * 		batchModelStart();
+	 * 		...do a some work ...
+	 * 		}
+	 * 	finally {
+	 * 		endBatchMode();
+	 * 		}
+	 * 
+	 * 
+	 * </pre>
+	 */
+	public void batchModeStart() {
+		isBatchChanges = true;
+		getXMLModel().aboutToChangeModel();
+		setRootNodeAdapterNotificationEnabled(false);
+	}
+
+	/**
+	 * see batchModelEnd
+	 * 
+	 */
+
+	public void batchModeEnd() {
+		getXMLModel().changedModel();
+		setRootNodeAdapterNotificationEnabled(true);
+		isBatchChanges = false;
+	}
+
 	public boolean isBatchMode() {
 		return isBatchChanges;
 	}
@@ -439,8 +508,11 @@
 		EObject root = resource.getRootObject();
 		if (root != null) {
 			EMF2DOMAdapter adapter = (EMF2DOMAdapter) EcoreUtil.getExistingAdapter(root, EMF2DOMAdapter.ADAPTER_CLASS);
-			if (adapter != null)
+			if (adapter != null) {
 				adapter.setNotificationEnabled(b);
+				if (b)
+					adapter.updateDOM();
+			}
 		}
 	}
 
@@ -499,11 +571,11 @@
 
 	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-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
deleted file mode 100644
index 6c1dcde..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/ComponentSearchContributor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public abstract class ComponentSearchContributor  {
-
-	protected HashMap declarations;
-
-	protected HashMap references;
-
-	protected String[] namespaces;
-
-	public ComponentSearchContributor() {
-		super();
-	}
-
-	public XMLSearchPattern getDeclarationPattern(QualifiedName componentName) {
-		return (XMLSearchPattern) getDeclarations().get(componentName);
-	}
-
-	protected Map getDeclarations() {
-		if (declarations == null) {
-			initializeDeclarations();
-		}
-		return declarations;
-	}
-
-	protected Map getReferences() {
-		if (references == null) {
-			initializeReferences();
-		}
-		return references;
-	}
-
-	public XMLSearchPattern[] getReferencesPatterns(QualifiedName componentName) {
-		List references = (List) getReferences().get(componentName);
-		if (references != null) {
-			return (XMLSearchPattern[]) references
-					.toArray(new XMLSearchPattern[references.size()]);
-		}
-		return new XMLSearchPattern[0];
-	}
-	
-	
-	public boolean supports(QualifiedName componentName){
-		return getReferencesPatterns(componentName).length > 0 ||
-			getDeclarationPattern(componentName) != null;
-	}
-
-	public String[] getSupportedNamespaces() {
-		return namespaces;
-	}
-
-	protected abstract void initializeDeclarations();
-
-	protected abstract void initializeReferences();
-
-	protected abstract void initializeSupportedNamespaces();
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
deleted file mode 100644
index 6321b7c..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/TargetNamespaceReferencePattern.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-
-public class TargetNamespaceReferencePattern extends SearchPattern {
-	
-	String namespaceURI;
-	
-	public TargetNamespaceReferencePattern(int matchRule, String namespaceuri) {
-		super(matchRule);
-		namespaceURI = namespaceuri;
-	}
-	
-	public TargetNamespaceReferencePattern(String namespaceuri) {
-		super();
-		namespaceURI = namespaceuri;
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
deleted file mode 100644
index 19f475b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentDeclarationPattern.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentDeclarationPattern extends XMLComponentSearchPattern {
-
-	public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(null, elementQName, typeQName, matchRule);
-		
-	}
-
-	public XMLComponentDeclarationPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-	}
-	
-	public XMLComponentDeclarationPattern(QualifiedName elementQName, QualifiedName typeQName) {
-		super(null, elementQName, typeQName);
-	}
-
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java
deleted file mode 100644
index e68a8a4..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentReferencePattern.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-public class XMLComponentReferencePattern extends XMLComponentSearchPattern{
-
-	public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(file, elementQName, typeQName, matchRule);
-		
-	}
-
-	public XMLComponentReferencePattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-		
-	}
-	
-	public XMLComponentReferencePattern(QualifiedName elementQName, QualifiedName typeQName) {
-		super(null, elementQName, typeQName);
-		
-	}
-	
-	
-	
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
deleted file mode 100644
index 7abd04b..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLComponentSearchPattern.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-
-/**
- * XML component search pattern is a composite pattern that combines XML element pattern.
- *
- */
-public class XMLComponentSearchPattern extends ComponentSearchPattern {
-	
-	/**
-	 * Containing element patterns
-	 */
-	XMLSearchPattern[] children = new XMLSearchPattern[0];
-	
-
-	public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName, int matchRule) {
-		super(file, elementQName, typeQName, matchRule);
-		
-	}
-
-
-	public XMLComponentSearchPattern(IFile file, QualifiedName elementQName, QualifiedName typeQName) {
-		super(file, elementQName, typeQName);
-		
-	}
-
-	public XMLSearchPattern[] getChildren(){
-		return children;
-	}
-	
-	public void setChildren(XMLSearchPattern[] patterns){
-		children = patterns;
-		
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
deleted file mode 100644
index 8edf86d..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchParticipant.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import java.util.HashMap;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.document.SearchDocumentSet;
-import org.eclipse.wst.common.core.search.pattern.ComponentSearchPattern;
-import org.eclipse.wst.common.core.search.pattern.FileReferencePattern;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.common.core.search.scope.ContentTypeSearchScope;
-import org.eclipse.wst.common.core.search.scope.SearchScope;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolver;
-import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.impl.XMLSearchDocument;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.XMLSearchPatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.quickscan.XMLQuickScan;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- *
- */
-public abstract class XMLSearchParticipant extends SearchParticipant {
-	
-	String[] supportedContentTypes;
-	
-	protected static final boolean debugPerf = "true".equalsIgnoreCase(Platform.getDebugOption("org.eclipse.wst.xml.core.internal.search/perf")); //$NON-NLS-1$ //$NON-NLS-2$
-
-	public XMLSearchParticipant() {
-		super();
-	}
-	
- public  boolean initialize(SearchPattern pattern, String[] contentTypes){
-		
-	    super.initialize(pattern, contentTypes);
-		this.supportedContentTypes = contentTypes;
-		
-		if(pattern instanceof XMLComponentSearchPattern){
-			return true;
-		}
-		return false;
-	}
-
-	
-
-	public SearchDocument getDocument(String documentPath) {
-
-		return new XMLSearchDocument(documentPath, this);
-
-	}
-
-	public String getDescription() {
-		return "XML search participant"; //$NON-NLS-1$
-	}
-
-
-
-	private void locateMatches(SearchPattern pattern, SearchDocument document,
-			SearchRequestor requestor, IProgressMonitor monitor) {
-
-		if (document.getModel() instanceof IDOMModel) {
-			IDOMModel domModel = (IDOMModel) document.getModel();
-			IDOMElement contextNode = (IDOMElement) domModel.getDocument()
-					.getDocumentElement();
-			DOMVisitor visitor = new DOMVisitor(document.getPath(), pattern,
-					requestor);
-			visitor.visit(contextNode);
-		}
-
-	}
-	
-	private PatternMatcher getAdapter(Object adaptableObject, Class adapterType) {
-		if (PatternMatcher.class.equals(adapterType) &&
-				(adaptableObject instanceof XMLSearchPattern ||
-				adaptableObject instanceof XMLComponentSearchPattern) ) {
-			return new XMLSearchPatternMatcher();
-		} 
-		return null; 
-	}
-
-	private class DOMVisitor {
-
-		String path;
-		SearchPattern pattern;
-		SearchRequestor requestor;
-		PatternMatcher matcher;
-
-		
-		protected DOMVisitor(String path, SearchPattern pattern,
-				SearchRequestor requestor) {
-			super();
-			this.path = path;
-			this.pattern = pattern;
-			
-			matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
-			if(matcher == null){
-				matcher = getAdapter(pattern, PatternMatcher.class);
-			}
-			this.requestor = requestor;
-		}
-
-		private void visit(Node node) {
-			if (node.getNodeType() == Node.ELEMENT_NODE) {
-				match((Element)node);
-				NodeList nodeList = node.getChildNodes();
-				for (int i = 0; i < nodeList.getLength(); i++) {
-					Node aNode = nodeList.item(i);
-					visit(aNode);
-				}
-			}
-		}
-
-		private void match(Element node) {
-			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(
-					new Path(path));
-			if(matcher != null){
-				matcher.locateMatches(pattern, file, node, requestor);
-			}
-
-			
-		}
-
-	}
-
-	public SearchScope selectDocumentLocations(SearchPattern pattern, SearchScope scope, IProgressMonitor monitor) {
-		/*
-		 * gate #1: reduce the scope to the files with the content type that
-		 * could be searched using this participant
-		 */ 
-		String[] contentTypes = getSupportedContentTypes();	
-		if(contentTypes != null && contentTypes.length > 0){
-			scope = new ContentTypeSearchScope(scope, contentTypes);
-		}
-		return super.selectDocumentLocations(pattern, scope, monitor);
-	}
-	
-	public abstract ComponentSearchContributor getSearchContributor();
-
-
-	public void beginSearching(SearchPattern pattern) {
-		
-		super.beginSearching(pattern);
-		if(pattern instanceof XMLComponentDeclarationPattern){
-			XMLComponentDeclarationPattern componentPattern = (XMLComponentDeclarationPattern)pattern;
-			XMLSearchPattern childPattern = getSearchContributor().getDeclarationPattern(componentPattern.getMetaName());
-			if(childPattern != null){
-					childPattern.setSearchName(componentPattern.getName().getLocalName());
-					childPattern.setSearchNamespace(componentPattern.getName().getNamespace());
-	     			componentPattern.setChildren(new XMLSearchPattern[]{childPattern});
-			}
-			
-		}
-		else if(pattern instanceof XMLComponentReferencePattern){
-			XMLComponentReferencePattern componentPattern = (XMLComponentReferencePattern)pattern;
-			XMLSearchPattern[] childPatterns = getSearchContributor().getReferencesPatterns(componentPattern.getMetaName());
-			for (int i = 0; i < childPatterns.length; i++) {
-				XMLSearchPattern childPattern = childPatterns[i];
-				childPattern.setSearchName(componentPattern.getName().getLocalName());
-				childPattern.setSearchNamespace(componentPattern.getName().getNamespace());				
-			}
-			componentPattern.setChildren(childPatterns);
-			
-		}
-	}
-	
-	
-	/**
-	 * The intend of this method is to limit the search to the files that have content 
-	 * which can be searched for the given pattern. It is called from 
-	 * {@link #selectDocumentLocations(SearchPattern, SearchScope, IProgressMonitor)}
-	 * 
-	 * @param pattern the search pattern that is searched for
-	 * @return content type's unique identifiers that could be searched for the given pattern.
-	 */
-	public String[] getSupportedContentTypes(){
-		return supportedContentTypes;
-	}
-
-	public void populateSearchDocument(SearchDocument document, SearchPattern pattern)
-	{
-		PatternMatcher matcher = (PatternMatcher)pattern.getAdapter(PatternMatcher.class);
-		if(matcher == null){
-			matcher = getAdapter(pattern, PatternMatcher.class);
-		}
-		XMLQuickScan.populateSearchDocument(document, matcher, pattern);		
-	}
-
-	public void locateMatches(SearchDocumentSet documentSet, SearchPattern pattern, SearchScope scope, SearchRequestor requestor, IProgressMonitor monitor) throws CoreException
-	{
-		long time = System.currentTimeMillis();
-		
-		// TODO: use the file reference entries in the documents to reduce the scope to the referenced files only
-		// SearchDocument[] documents = documentSet.getSearchDocuments(id);
-                
-        // check to see if the search pattern is qualified by a file location
-        // if this is the case then we can use file scoping rules to prune the matches
-        IFile targetFile = null;
-        if (pattern instanceof ComponentSearchPattern)
-        {
-          ComponentSearchPattern componentSearchPattern = (ComponentSearchPattern)pattern;
-          targetFile = componentSearchPattern.getFile();                                       
-        }		
-        
-		// here we should have in scope only referenced files
-		IFile[] files = scope.enclosingFiles();  
-		for (int i = 0; i < files.length; i++)
-		{
-			IFile file = files[i];
-			String path = file.getLocation().toString();
-			SearchDocument document = documentSet.getSearchDocument(path, id); 
-			Entry[] entries = document.getEntries(getSearchEntryCategory(pattern), null, 0);           
-			if(entries != null && entries.length > 0)
-            {
-              //for (int j = 0; j < entries.length; j++)
-              //{
-              //  Entry entry = entries[j];
-                //System.out.println("entry " + entry.getCategory() + " " + entry.getKey() + " " + entry.getClass().getName());                 
-              //}  
-              
-              boolean isInScope = true;
-              if (targetFile != null)
-              {
-                try
-                {
-                  isInScope = isLinked(documentSet, "file:///" + path, "file:///" + targetFile.getLocation().toString());
-                  //if (path.endsWith("CancelSelection.wsdl")  && path.indexOf("clone1") != -1)
-                  //{
-                  //  fileReferenceTable.debug(qualifiedPath, 0, 5);
-                  //}                   
-                }
-                catch (Exception e)
-                {
-                  e.printStackTrace();
-                }
-              }              
-              if (isInScope)
-              { 
-			    this.locateMatches(pattern, document, requestor, monitor);
-              }  
-            }
-		}
-		
-		
-		if (debugPerf)
-		{
-			System.out
-					.println(""
-							+ getDescription()
-							+ ": " + (System.currentTimeMillis() - time) + "ms for locateMatches"); //$NON-NLS-1$ //$NON-NLS-2$
-		}
-
-		
-	}
-    
-    private boolean isLinked(SearchDocumentSet set, String source, String target)
-    {
-      return isLinked(set, source, target, new HashMap());
-    }
-    
-    private boolean isLinked(SearchDocumentSet set, String source, String target, HashMap visited)
-    {
-      if (source.equals(target))
-        return true;
-      
-      String fileProtocol = "file:///";            
-      if (source.startsWith(fileProtocol))
-      {    
-        
-      SearchDocument document = set._tempGetSearchDocumetn(source.substring(fileProtocol.length()));      
-      if (document != null)
-      {        
-        URIResolver uriResolver = URIResolverPlugin.createResolver();        
-        Entry[] entries = document.getEntries(IXMLSearchConstants.REF, null, 0);
-        String[] resolveEntry = new String[entries.length];        
-        for (int j = 0; j < entries.length; j++)
-        {
-          Entry entry = entries[j];
-          if (entry instanceof FileReferenceEntry)
-          {
-            FileReferenceEntry fileReferenceEntry = (FileReferenceEntry)entry;
-            // TODO.. record an utilize the public id from the fileReferenceEntry
-            //
-            if (fileReferenceEntry.getRelativeFilePath() != null)
-            {  
-              String resolvedURI = uriResolver.resolve(source, null, fileReferenceEntry.getRelativeFilePath());
-              resolveEntry[j] = resolvedURI;
-              if (resolvedURI.equals(target))
-              {
-                return true;
-              }             
-            }  
-          }
-        }
-        // now see if there's an indirect link from the source to the target
-        // we keep track of the nodes we've already visited to avoid cycles
-        if (visited.get(source) == null)
-        {
-          visited.put(source, Boolean.TRUE);
-          for (int j = 0; j < entries.length; j++)
-          {                     
-            String resolvedURI = resolveEntry[j];
-            if (resolvedURI != null && isLinked(set, resolveEntry[j], target, visited))                
-              return true;            
-          }    
-        }                      
-      }            
-      } 
-      return false;
-    }
-    
-   
-    
-	public static String getSearchEntryCategory(SearchPattern pattern){
-		if(pattern instanceof XMLComponentDeclarationPattern){
-			return IXMLSearchConstants.COMPONENT_DECL;
-		}
-		else if(pattern instanceof XMLComponentReferencePattern){
-			return IXMLSearchConstants.COMPONENT_REF;
-		}
-		else if(pattern instanceof FileReferencePattern){
-		   return IXMLSearchConstants.COMPONENT_REF;
-		}
-		return null;
-	}   
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
deleted file mode 100644
index 1fb55d7..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/XMLSearchPattern.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search;
-
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-
-public class XMLSearchPattern extends SearchPattern{
-	
-	private String elementNamespace = null;
-	private String elementName = null;
-	private String attributeName = null;
-	private String searchName = null;
-	private String searchNamespace = null;
-	
-	public XMLSearchPattern(String elementNamespace, String elementName, String attributeName) {
-		super();
-		this.attributeName = attributeName;
-		this.elementName = elementName;
-		this.elementNamespace = elementNamespace;
-	}
-	
-	public XMLSearchPattern(){
-		
-	}
-	
-	public String getAttributeName() {
-		return attributeName;
-	}
-
-	public String getElementName() {
-		return elementName;
-	}
-
-	public String getElementNamespace() {
-		return elementNamespace;
-	}
-
-	public String getSearchName() {
-		return searchName;
-	}
-
-	public String getSearchNamespace() {
-		return searchNamespace;
-	}
-
-	public void setSearchName(String searchName) {
-		this.searchName = searchName;
-	}
-
-	public void setSearchNamespace(String searchNamespace) {
-		this.searchNamespace = searchNamespace;
-	}
-
-	public void setAttributeName(String attributeName) {
-		this.attributeName = attributeName;
-	}
-
-	public void setElementName(String elementName) {
-		this.elementName = elementName;
-	}
-
-	public void setElementNamespace(String elementNamespace) {
-		this.elementNamespace = elementNamespace;
-	}
-	
-
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
deleted file mode 100644
index d160d81..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/IXMLSearchConstants.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-public interface IXMLSearchConstants
-{
-		String REF= "outLink"; //$NON-NLS-1$
-		String COMPONENT_DECL = "componentDecl"; //$NON-NLS-1$
-		String COMPONENT_REF = "componentDecl"; //$NON-NLS-1$
-	
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
deleted file mode 100644
index d7ae22f..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/Messages.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-import java.text.MessageFormat;
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
-	
-	private static final String BUNDLE_NAME = "org.eclipse.wst.xml.core.internal.search.messages";//$NON-NLS-1$
-
-	
-	static {
-		NLS.initializeMessages(BUNDLE_NAME, Messages.class);
-	}
-	private Messages() {
-		// Do not instantiate
-	}
-	
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @return the manipulated String
-	 */
-	public static String bind(String message) {
-		return bind(message, null);
-	}
-	
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param binding the object to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object binding) {
-		return bind(message, new Object[] {binding});
-	}
-
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param binding1 An object to be inserted into the message
-	 * @param binding2 A second object to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object binding1, Object binding2) {
-		return bind(message, new Object[] {binding1, binding2});
-	}
-
-	/**
-	 * Bind the given message's substitution locations with the given string values.
-	 * 
-	 * @param message the message to be manipulated
-	 * @param bindings An array of objects to be inserted into the message
-	 * @return the manipulated String
-	 */
-	public static String bind(String message, Object[] bindings) {
-		return MessageFormat.format(message, bindings);
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
deleted file mode 100644
index 281a856..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/impl/XMLSearchDocument.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.impl;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.core.search.document.Entry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.sse.core.internal.provisional.StructuredModelManager;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchParticipant;
-
-public class XMLSearchDocument extends SearchDocument {
-	
-	IDOMModel model;
-	Map entries = new HashMap(); // category -> set (entry)	
-
-	public XMLSearchDocument(String documentPath, XMLSearchParticipant participant) {
-		super(documentPath, participant);
-	}
-
-	public Object getModel() {
-		if(model == null){
-            //System.out.println("creating DOM for " + getPath());
-			IFile file = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(new Path(getPath()));
-			if(file != null){
-				try {
-					model = (IDOMModel)StructuredModelManager.getModelManager().getModelForRead(file);
-				} catch (IOException e) {
-					e.printStackTrace();
-				} catch (CoreException e) {
-					e.printStackTrace();
-				}
-			
-			}
-		}
-		return model;
-	}
-
-	public Entry[] getEntries(String category, String key, int matchRule)
-	{
-		// TODO use matchRule
-		Set results = new HashSet();
-		if(category != null){
-			Set values = (Set)entries.get(category);
-			if(values == null){
-				return new Entry[0];
-			}
-			if(key == null || "".equals(key) || "*".equals(key)){
-				// entries with any key in the given category
-				results.addAll(values);
-			}
-			else{
-				// entries with the specified key in the given category
-				for (Iterator iter = values.iterator(); iter.hasNext();)
-				{
-					Entry entry = (Entry) iter.next();
-					if(key.equals(entry.getKey())){
-						results.add(entry);
-					}
-				}
-			}
-			
-		}
-		return (Entry[]) results.toArray(new Entry[results.size()]);
-	}
-
-	public void putEntry(Entry entry)
-	{
-		if(entry.getCategory() != null){
-			Set values = (Set)entries.get(entry.getCategory());
-			if(values == null){
-				entries.put(entry.getCategory(), values=new HashSet());
-			}
-            if (entry instanceof FileReferenceEntry && getPath().endsWith("CancelSelection.wsdl")
-                && getPath().indexOf("clone1") != -1)              
-            {
-              FileReferenceEntry fileReferenceEntry = (FileReferenceEntry)entry;
-              System.out.println("fileReferenceEntry(" + fileReferenceEntry.getCategory() + ", " + fileReferenceEntry.getRelativeFilePath() + ")");
-            }  
-			values.add(entry);
-		}
-		
-	}
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
deleted file mode 100644
index 05f4ff1..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/PatternMatcher.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.wst.common.core.search.SearchMatch;
-import org.eclipse.wst.common.core.search.SearchParticipant;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-/**
- * This class contains matching implementation.  
- * <p>
- * Subclasses of the PatternMatches should provide an implementation of the specific pattern matching.
- * </p>
- * <p>
- * Subclasses of the PatternMatches should be set as adapters for the patterns that they match.
- * </p>
- * An implementation of {@link SearchParticipant#selectDocumentLocations()} will call 
- * { @link PatternMatcher#matches() } on the adapter on pattern matcher.
- * 
- * An implementation of {@link SearchParticipant#locateMatches()} will call 
- * { @link PatternMatcher#locateMatches() } on the adapter on pattern matcher.
- *
- */
-public abstract class PatternMatcher {
-	
-	
-	/**
-	 * This method does dive actual match location to the requestor if there are matches
-	 */
-	public abstract void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor);
-
-	/**
-	 * This method only answers if the pattern matches element, it does not give actual match location
-	 */
-	public abstract boolean matches(SearchPattern pattern, Object element);
-	
-	protected void addMatch(SearchPattern pattern, IFile file, Attr attributeNode, SearchRequestor requestor) {
-        //System.out.println("addMatch " + pattern + " " + attributeNode.getName() + "=" + attributeNode.getValue());
-		if (attributeNode != null) {
-				int start = 0;
-				int length = 0;
-				if(attributeNode instanceof IDOMAttr){
-					IDOMAttr domAttr = (IDOMAttr)attributeNode;
-					start = domAttr.getValueRegionStartOffset();
-					length = domAttr.getValueRegionText().length();
-				}
-				SearchMatch match = new SearchMatch(attributeNode,
-						start,
-						length,
-						file);
-				if(requestor != null){
-					try {
-						requestor.acceptSearchMatch(match);
-					} catch (CoreException e) {
-						//do nothing
-					}
-				}
-		}
-	}
-
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
deleted file mode 100644
index 330d144..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/SAXSearchElement.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.xml.sax.Attributes;
-
-public class SAXSearchElement{
-	Attributes attributes;
-	String elementName;
-	String elementNamespace;
-	Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
-	String targetNamespace = "";
-	
-	public SAXSearchElement() {
-		super();
-	}
-	public Attributes getAttributes() {
-		return attributes;
-	}
-	public String getElementName() {
-		return elementName;
-	}
-	public String getElementNamespace() {
-		return elementNamespace;
-	}
-	public Map getNamespaceMap() {
-		return namespaceMap;
-	}
-	public String getTargetNamespace() {
-		return targetNamespace;
-	}
-	public void setAttributes(Attributes attributes) {
-		this.attributes = attributes;
-	}
-	public void setElementName(String elementName) {
-		this.elementName = elementName;
-	}
-	public void setElementNamespace(String elementNamespace) {
-		this.elementNamespace = elementNamespace;
-	}
-	public void setNamespaceMap(Map namespaceMap) {
-		this.namespaceMap = namespaceMap;
-	}
-	public void setTargetNamespace(String targetNamespace) {
-		this.targetNamespace = targetNamespace;
-	}
-	
-	
-	
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
deleted file mode 100644
index 1c7d2d0..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/matching/XMLSearchPatternMatcher.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.matching;
-
-import org.apache.xml.utils.PrefixResolverDefault;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.wst.common.core.search.SearchRequestor;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLSearchPattern;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-
-public class XMLSearchPatternMatcher extends PatternMatcher{
-	
-
-
-	protected void initialize(XMLSearchPattern pattern, Element domElement) {
-	
-			pattern.setElementName(domElement.getLocalName());
-			pattern.setElementNamespace(domElement.getNamespaceURI());
-			String actualValue = domElement.getAttribute(pattern.getAttributeName());
-			 if(actualValue != null){
-					int n = actualValue.indexOf(":");
-					if(n > 0){
-						String prefix = actualValue.substring(0, n);
-						pattern.setSearchName(actualValue.substring(n+1));                       
-						PrefixResolverDefault prefixresolver = new PrefixResolverDefault(domElement.getOwnerDocument());
-						pattern.setSearchNamespace(prefixresolver.getNamespaceForPrefix(prefix, domElement));
-					
-					}
-					else {
-						pattern.setSearchName(actualValue);
-						pattern.setSearchNamespace(domElement.getOwnerDocument().getDocumentElement().getAttribute("targetNamespace"));
-					}
-			    }
-		
-	}
-	
-	protected void initialize(XMLSearchPattern pattern, SAXSearchElement saxElement) {
-		
-		pattern.setElementName(saxElement.getElementName());
-		pattern.setElementNamespace(saxElement.getElementNamespace());
-		String actualValue = saxElement.getAttributes().getValue(pattern.getAttributeName());
-		 if(actualValue != null){
-				int n = actualValue.indexOf(":");
-				if(n > 0){
-					String prefix = actualValue.substring(0, n);
-					pattern.setSearchName(actualValue.substring(n+1));
-					pattern.setSearchNamespace((String)saxElement.getNamespaceMap().get(prefix));
-				
-				}
-				else {
-					pattern.setSearchName(actualValue);
-					pattern.setSearchNamespace(saxElement.getTargetNamespace());
-				}
-		    }
-	
-	}
-	
-	XMLSearchPattern searchPattern;
-	
-	public XMLSearchPatternMatcher() {
-		super();
-		
-	}
-
-	
-
-	
-	/**
-	 * This method does dive actual match location to the requestor if there are matches
-	 */
-	
-	public void locateMatches(SearchPattern pattern, IFile file, Element element, SearchRequestor requestor) {
-		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren();
-			for (int i = 0; i < childPatterns.length; i++) {
-				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
-				if(matcher == null){
-					matcher = this;
-				}
-				if(matcher != null){
-					matcher.locateMatches(childPatterns[i], file, element, requestor);
-				}
-			}
-		}
-		else if(pattern instanceof XMLSearchPattern){
-			if(matches(pattern, element)){
-				Attr attribute = element.getAttributeNode(((XMLSearchPattern)pattern).getAttributeName());
-				addMatch(pattern, file, attribute, requestor);
-			}
-		
-		}
-	}
-	
-	/**
-	 * This method only answers if the pattern matches element, it does not give actual match location
-	 */
-	public boolean matches(SearchPattern pattern, Object element){
-		if(pattern instanceof XMLComponentSearchPattern){
-			XMLSearchPattern[] childPatterns = ((XMLComponentSearchPattern)pattern).getChildren();
-			for (int i = 0; i < childPatterns.length; i++) {
-				PatternMatcher matcher = (PatternMatcher)childPatterns[i].getAdapter(PatternMatcher.class);
-				if(matcher == null){
-					matcher = this;
-				}
-				if(matcher != null){
-					if(matcher.matches(childPatterns[i], element)){
-						return true;
-					}
-				}
-				
-			}
-		}
-		else if(pattern instanceof XMLSearchPattern){
-			
-			XMLSearchPattern possibleMatch = new XMLSearchPattern();
-			possibleMatch.setAttributeName(((XMLSearchPattern)pattern).getAttributeName());
-			if(element instanceof Element){
-				initialize(possibleMatch, (Element)element);
-			}
-			else if(element instanceof SAXSearchElement){
-				initialize(possibleMatch, (SAXSearchElement)element);
-			}
-			searchPattern = (XMLSearchPattern)pattern;
-			return matchesPattern(possibleMatch);
-		}
-		return false;
-	}
-	
-	protected boolean matchesPattern(SearchPattern pattern) {
-		if(searchPattern != null && pattern instanceof XMLSearchPattern){
-			XMLSearchPattern decodedPattern = (XMLSearchPattern)pattern;
-			if(searchPattern.getElementName().equals(decodedPattern.getElementName()) &&
-					searchPattern.getElementNamespace().equals(decodedPattern.getElementNamespace())){
-				if(searchPattern.getSearchName() == null) return false;
-				if(searchPattern.getSearchNamespace() == null){
-					return searchPattern.getSearchName().equals(decodedPattern.getSearchName());
-				}
-				else{
-					return searchPattern.getSearchName().equals(decodedPattern.getSearchName()) &&
-					searchPattern.getSearchNamespace().equals(decodedPattern.getSearchNamespace());
-				}
-			}
-		}
-		
-		return false;
-	}
-	
-
-}
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.java
deleted file mode 100644
index 34e7dc5..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScan.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.xml.core.internal.search.quickscan;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.xml.sax.InputSource;
-import org.xml.sax.XMLReader;
-
-/**
- * 
- */
-public class XMLQuickScan
-{
-
-	public static String getTargetNamespace(String fullFilePath)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler();
-		parseFile(fullFilePath, handler);
-		return handler.getTargetNamespace();
-	}
-	
-	/*
-	 * Returns information about matches encountered based on the criteria
-	 * provided.
-	 */
-	public static boolean hasMatch(String fullFilePath, PatternMatcher matcher, SearchPattern pattern)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(matcher, pattern);
-		parseFile(fullFilePath, handler);
-		return handler.hasMatch();
-	}
-	
-	public static boolean populateSearchDocument(SearchDocument document, PatternMatcher matcher, SearchPattern pattern)
-	{
-		XMLQuickScanContentHandler handler = new XMLQuickScanContentHandler(document, matcher, pattern);
-		parseFile(document.getPath(), handler);
-		return handler.hasMatch();
-	}
-
-	private static void parseFile(String fullFilePath,
-			XMLQuickScanContentHandler handler)
-	{
-		FileInputStream inputStream = null;
-		try
-		{
-			inputStream = new FileInputStream(new File(fullFilePath));
-			SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
-			
-			XMLReader reader = parser.getXMLReader();
-			reader.setFeature("http://xml.org/sax/features/namespaces", true);
-			reader.setContentHandler(handler);
-			reader.parse(new InputSource(inputStream));
-		} catch (Exception e)
-		{
-			// skip the file
-		} 
-		finally{
-			if(inputStream != null){
-				try {
-					inputStream.close();
-				} catch (IOException e) {
-					// can not do much 
-				}
-			}
-			
-		}
-	}
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java b/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
deleted file mode 100644
index 4a17d1e..0000000
--- a/bundles/org.eclipse.wst.xml.core/src-search/org/eclipse/wst/xml/core/internal/search/quickscan/XMLQuickScanContentHandler.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2006 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors:
- *     IBM Corporation - Initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.wst.xml.core.internal.search.quickscan;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.wst.common.core.search.document.ComponentDeclarationEntry;
-import org.eclipse.wst.common.core.search.document.ComponentReferenceEntry;
-import org.eclipse.wst.common.core.search.document.FileReferenceEntry;
-import org.eclipse.wst.common.core.search.document.SearchDocument;
-import org.eclipse.wst.common.core.search.pattern.QualifiedName;
-import org.eclipse.wst.common.core.search.pattern.SearchPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentDeclarationPattern;
-import org.eclipse.wst.xml.core.internal.search.XMLComponentReferencePattern;
-import org.eclipse.wst.xml.core.internal.search.impl.IXMLSearchConstants;
-import org.eclipse.wst.xml.core.internal.search.matching.PatternMatcher;
-import org.eclipse.wst.xml.core.internal.search.matching.SAXSearchElement;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-
-/**
- * This class is a SAX content handler, it should be recycled before scanning a file for the new SearchPattern.
- *
- */
-public class XMLQuickScanContentHandler extends DefaultHandler
-{
-	private Map namespaceMap = new HashMap(); // Map of string prefix keys and namespace
-	private String targetNamespace = "";
-	
-	private SearchPattern pattern;
-	private SearchDocument document;  // we'll add useful entries in the search document as we parsing
-	private SAXSearchElement searchElement = new SAXSearchElement();
-
-	private boolean hasMatch = false;
-	private  StringBuffer currentPath = new StringBuffer();
-	private PatternMatcher matcher;
-	
-	public static final String XMLSCHEMA_NAMESPACE = "http://www.w3.org/2001/XMLSchema";
-
-	
-	public XMLQuickScanContentHandler(PatternMatcher matcher, SearchPattern pattern) {
-		super();
-		this.pattern = pattern;
-		this.matcher = matcher;
-	}
-	
-	public XMLQuickScanContentHandler(SearchDocument document, PatternMatcher matcher, SearchPattern pattern) {
-		super();
-		this.pattern = pattern;
-		this.matcher = matcher;
-		this.document = document;
-	}
-	
-	public XMLQuickScanContentHandler() {
-		super();
-	}
-
-	public void startElement(String uri, String localName, String qName,
-			Attributes attributes) throws SAXException
-	{
-	
-		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 ("targetNamespace".equals(attributes.getQName(i)))
-				{
-					targetNamespace = attributes.getValue(i);
-					break;
-				}
-			}
-		}
-		
-		// collect link info
-		if("import".equals(localName) && XMLSCHEMA_NAMESPACE.equals(uri)){
-			FileReferenceEntry documentEntry = new FileReferenceEntry();
-			documentEntry.setCategory(IXMLSearchConstants.REF);
-			documentEntry.setKey("import");
-			String namespace = attributes.getValue("namespace");
-			String location = attributes.getValue("schemaLocation");
-			documentEntry.setPublicIdentifier(namespace);
-			documentEntry.setRelativeFilePath(location);            
-			document.putEntry(documentEntry);
-		}
-		if(("redefine".equals(localName)|| "include".equals(localName)) &&
-				XMLSCHEMA_NAMESPACE.equals(uri)){
-			FileReferenceEntry documentEntry = new FileReferenceEntry();
-			documentEntry.setCategory(IXMLSearchConstants.REF);
-			documentEntry.setKey("include");
-			String location = attributes.getValue("schemaLocation");
-			documentEntry.setPublicIdentifier(uri);
-			documentEntry.setRelativeFilePath(location);
-			document.putEntry(documentEntry);
-		}
-		
-		
-        // issue (cs) you may want to try perf measurements to compate reusing the same
-        // instance of a SAXSearchElement instead of newing one each time 
-		//XMLSearchPattern.SAXSearchElement searchElement = new XMLSearchPattern.SAXSearchElement();
-		searchElement.setElementName(localName);
-		searchElement.setElementNamespace(uri);
-		searchElement.setAttributes(attributes);
-		searchElement.setNamespaceMap(namespaceMap);
-		searchElement.setTargetNamespace(targetNamespace);
-	
-
-		if(matcher != null){
-			if(matcher.matches(pattern, searchElement)){
-				hasMatch = true;
-				if(pattern instanceof XMLComponentReferencePattern){
-					ComponentReferenceEntry documentEntry = new ComponentReferenceEntry();
-					documentEntry.setCategory(IXMLSearchConstants.COMPONENT_REF);
-					QualifiedName name = new QualifiedName(uri, localName);
-					documentEntry.setKey(name.toString());
-					documentEntry.setName(name);
-					document.putEntry(documentEntry);
-				}
-				else if(pattern instanceof XMLComponentDeclarationPattern){
-					ComponentDeclarationEntry documentEntry = new ComponentDeclarationEntry();
-					documentEntry.setCategory(IXMLSearchConstants.COMPONENT_DECL);
-					QualifiedName name = new QualifiedName(uri, localName);
-					documentEntry.setKey(name.toString());
-					documentEntry.setName(name);
-					document.putEntry(documentEntry);
-				}
-			}
-		}
-		
-	}
-	
-	public void endElement(String uri, String localName, String qName)
-			throws SAXException
-	{
-		int slashIndex = currentPath.lastIndexOf("/");
-		currentPath.delete(slashIndex, currentPath.length());
-	}
-
-	/**
-	 * Callback for SAX parser
-	 * 
-	 * @see org.xml.sax.ContentHandler#startPrefixMapping(java.lang.String,
-	 *      java.lang.String)
-	 */
-	public void startPrefixMapping(String arg0, String arg1)
-			throws SAXException
-	{
-		if (arg0 != null && arg0.length() > 0)
-		{
-			this.namespaceMap.put(arg0, arg1);
-		}
-	}
-
-	public String getTargetNamespace() {
-		return targetNamespace;
-	}
-
-	public void setTargetNamespace(String targetNamespace) {
-		this.targetNamespace = targetNamespace;
-	}
-
-	public boolean hasMatch() {
-		return hasMatch;
-	}
-
-	
-}
\ No newline at end of file
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/XMLValidator.java
index a8bc261..103f874 100644
--- 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
@@ -19,11 +19,11 @@
 import java.io.Reader;
 import java.io.StringReader;
 import java.net.ConnectException;
+import java.net.URL;
 import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.Hashtable;
 import java.util.List;
-
 import org.apache.xerces.impl.XMLErrorReporter;
 import org.apache.xerces.parsers.StandardParserConfiguration;
 import org.apache.xerces.xni.NamespaceContext;
@@ -36,11 +36,14 @@
 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.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationManager;
+import org.xml.sax.Attributes;
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 import org.xml.sax.SAXParseException;
 import org.xml.sax.XMLReader;
 import org.xml.sax.ext.DeclHandler;
+import org.xml.sax.helpers.DefaultHandler;
 
 /**
  * This class performs validation using a xerces sax parser.  
@@ -52,6 +55,7 @@
 {
   protected URIResolver uriResolver = null;
   //protected MyEntityResolver entityResolver = null;
+  protected ErrorCustomizationManager errorCustomizationManager;
   protected Hashtable ingoredErrorKeyTable = new Hashtable();
 
   protected static final String IGNORE_ALWAYS = "IGNORE_ALWAYS"; //$NON-NLS-1$
@@ -115,6 +119,25 @@
       reader.setFeature("http://xml.org/sax/features/namespaces", valinfo.isNamespaceEncountered());               //$NON-NLS-1$
       reader.setFeature("http://xml.org/sax/features/validation", valinfo.isGrammarEncountered());  //$NON-NLS-1$
       reader.setFeature("http://apache.org/xml/features/validation/schema", valinfo.isGrammarEncountered()); //$NON-NLS-1$
+      reader.setContentHandler(new DefaultHandler()
+      {
+        public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException {
+          
+          if (errorCustomizationManager == null)
+          {
+            errorCustomizationManager = new ErrorCustomizationManager();
+//            if (errorCustomizationManager.isDocumentNamespaceApplicable(uri))
+//            {
+//              errorCustomizationManager.setActive(true);
+//            }  
+          }
+          errorCustomizationManager.startElement(uri, localName);                    
+        }
+        
+        public void endElement(String uri, String localName, String qName) throws SAXException {
+          errorCustomizationManager.endElement(uri, localName);
+        }
+      });      
       
       // MH make sure validation works even when a customer entityResolver is note set (i.e. via setURIResolver())
       if (entityResolver != null)
@@ -342,6 +365,23 @@
       {                     
         String physical = uriResolver.resolvePhysicalLocation(rid.getBaseSystemId(), id, location);
         is = new XMLInputSource(rid.getPublicId(), location, location);
+        
+        // This block checks that the file exists. If it doesn't we need to throw
+        // an exception so Xerces will report an error. note: This may not be
+        // necessary with all versions of Xerces but has specifically been 
+        // experienced with the version included in IBM's 1.4.2 JDK.
+        InputStream isTemp = null;
+        try
+        {
+          isTemp = new URL(physical).openStream();
+        }
+        finally
+        {
+          if(isTemp != null)
+          {
+            isTemp.close();
+          }
+        }
         is.setByteStream(new LazyURLInputStream(physical));      
       }
     }
@@ -526,6 +566,7 @@
 		      if (reportError)
 		      {
 		        super.reportError(domain, key, arguments, severity);
+		        errorCustomizationManager.considerReportedError(valinfo, key, arguments);
 		      }
 		    }
 		};
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
index 807ea9a..d364d24 100644
--- 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
@@ -191,5 +191,11 @@
   {
 	  return this.messageArguments;
   }
+  
+
+  public void setMessage(String message)
+  {
+    this.message = message;
+  }  
                                      
 }
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
new file mode 100644
index 0000000..ab6c170
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/eclipse/ErrorCustomizationPluginRegistryReader.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.eclipse;
+
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IExtensionRegistry;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorCustomizationRegistry;
+import org.eclipse.wst.xml.core.internal.validation.errorcustomization.ErrorMessageCustomizerDelegate;
+import org.osgi.framework.Bundle;
+/**
+ * This class reads the plug-in manifests and registers each extension
+ * error customizer with the ErrorCustomizationRegistry.
+ */
+public class ErrorCustomizationPluginRegistryReader {
+	
+	  protected static final String PLUGIN_ID = "org.eclipse.wst.xml.core";
+	  protected static final String ATT_CLASS = "class";
+	  protected static final String ATT_NAMESPACE = "namespace";
+	  protected static final String EXTENSION_POINT_ID = "errorCustomizer";
+	  protected static final String tagName = EXTENSION_POINT_ID;
+
+	  /**
+	   * Read from plugin registry for the errorcustomizer extension.
+	   */
+	  public void readRegistry()
+	  {
+	    IExtensionRegistry pluginRegistry = Platform.getExtensionRegistry();
+	    IExtensionPoint point = pluginRegistry.getExtensionPoint(PLUGIN_ID, EXTENSION_POINT_ID);
+	    if (point != null)
+	    {
+	      IConfigurationElement[] elements = point.getConfigurationElements();
+	      for (int i = 0; i < elements.length; i++)
+	      {
+	        readElement(elements[i]);
+	      }
+	    }
+	  }
+
+	  /**
+	   * readElement() - parse and deal with an extension like:
+	   *
+	   * <extension point="org.eclipse.wst.xml.core.errorCustomizer"
+	   *            id="specificErrorCustomizer"
+	   *            name="Specific Error Customizer">
+	   *   <errorCustomizer
+	   *   			namespace="http://specificnamespace"
+	   *   			class="org.eclipse.wst.xml.core.MySpecificErrorCustomizer/>
+	   * </extension>
+	   */
+	  protected void readElement(IConfigurationElement element)
+	  {
+	    if (element.getName().equals(tagName))
+	    {
+	      String errorCustomizerClass = element.getAttribute(ATT_CLASS);
+	      String namespace = element.getAttribute(ATT_NAMESPACE);
+
+	      if (errorCustomizerClass != null)
+	      {
+	        try
+	        {
+	          Bundle pluginBundle = Platform.getBundle(element.getDeclaringExtension().getNamespace());
+	          ErrorMessageCustomizerDelegate delegate = new ErrorMessageCustomizerDelegate(pluginBundle, errorCustomizerClass);
+	          ErrorCustomizationRegistry.getInstance().addErrorMessageCustomizer(namespace, delegate);
+	        }
+	        catch (Exception e)
+	        {
+	        }
+	      }
+	    }
+	  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
new file mode 100644
index 0000000..eb1cca2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ElementInformation.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * A simple class to store information about an XML element.
+ */
+public class ElementInformation
+{
+  protected String localName;
+  protected String namespace;
+  protected List children = new ArrayList();
+
+  /**
+   * Constructor.
+   * 
+   * @param uri
+   * 		The namespace URI of the element.
+   * @param localName
+   * 		The local name of the element.
+   */
+  public ElementInformation(String uri, String localName)
+  {
+    this.localName = localName;
+    this.namespace = uri;
+  }
+  
+  /**
+   * Get the namespace of this element.
+   * 
+   * @return
+   * 		The namespace of this element.
+   */
+  public String getNamespace()
+  {
+	return namespace;
+  }
+  
+  /**
+   * Get the local name of this element.
+   * 
+   * @return
+   * 		The local name of this element.
+   */
+  public String getLocalname()
+  {
+	return localName;
+  }
+  
+  /**
+   * Get the list of children of this element. The list contains
+   * ElementInformation objects representing the children of this element.
+   * 
+   * @return
+   * 		The list of children of this element.
+   */
+  public List getChildren()
+  {
+	return children;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
new file mode 100644
index 0000000..745acc0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationManager.java
@@ -0,0 +1,110 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import java.util.Stack;
+
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationInfo;
+import org.eclipse.wst.xml.core.internal.validation.core.ValidationMessage;
+
+/**
+ * This class tracks the context of the parsed document to help identify error
+ * conditions
+ */
+public class ErrorCustomizationManager
+{
+  protected Stack elementInformationStack = new Stack();
+  protected ErrorMessageInformation messageForConsideration;
+
+  /**
+   * This method should be called in the start element method of the XML validator's
+   * content handler.
+   * 
+   * @param uri
+   * 		The namespace of the element.
+   * @param localName
+   * 		The local name of the element.
+   */
+  public void startElement(String uri, String localName)
+  { 
+    ElementInformation elementInformation = new ElementInformation(uri, localName);
+    if (elementInformationStack.size() > 0)
+    {
+      ElementInformation parent = (ElementInformation) elementInformationStack.peek();
+      parent.children.add(elementInformation);
+    }
+    elementInformationStack.push(elementInformation);
+  }
+
+  /**
+   * This method should be called in the end element method of the XML validator's
+   * content handler.
+   * 
+   * @param uri
+   * 		The namespace of the element.
+   * @param localName
+   * 		The local name of the element.
+   */
+  public void endElement(String uri, String localName)
+  {   
+    if (elementInformationStack.size() > 0)
+    {
+      ElementInformation elementInformation = (ElementInformation)elementInformationStack.pop();
+      if (messageForConsideration != null)
+      {  
+        IErrorMessageCustomizer[] customizers = ErrorCustomizationRegistry.getInstance().getCustomizers(elementInformation.getNamespace());
+        int numCustomizers = customizers.length;
+        for(int i = 0; i < numCustomizers; i++)
+        {
+          String message = customizers[i].customizeMessage(elementInformation, messageForConsideration.key, messageForConsideration.arguments);
+          if(message != null)
+          {
+        	messageForConsideration.message.setMessage(message);
+        	break;
+          }
+        }
+      }  
+    }
+  }
+
+  /**
+   * Consider the reported error for customization.
+   * 
+   * @param valInfo
+   * 		The current ValidationInfo object containing validation specific information.
+   * @param key
+   * 		The key related to the message.
+   * @param arguments
+   * 		Any message arguments.
+   */
+  public void considerReportedError(ValidationInfo valInfo, String key, Object[] arguments)
+  {
+    messageForConsideration = null;
+    ValidationMessage[] messages = valInfo.getValidationMessages();
+    if (messages.length > 0)
+    {  
+      messageForConsideration = new ErrorMessageInformation();
+      messageForConsideration.key = key;
+      messageForConsideration.arguments = arguments;
+      messageForConsideration.message = messages[messages.length - 1]; 
+    }
+  }
+  
+  /**
+   * A simple class to hold error message information.
+   */
+  public class ErrorMessageInformation
+  {
+	public String key = null;
+	public Object[] arguments = null;
+	public ValidationMessage message = null;
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
new file mode 100644
index 0000000..db0d0ce
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorCustomizationRegistry.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * The error customization regsitry manages all registered
+ * IErrorMessageCustomizers by namespace.
+ */
+public class ErrorCustomizationRegistry 
+{
+  protected static ErrorCustomizationRegistry registry = null;
+  protected Map customizers = new HashMap();
+  
+  /**
+   * Restricted constructor in keeping with the singleton pattern.
+   */
+  protected ErrorCustomizationRegistry()
+  {
+  }
+  
+  /**
+   * Get the one and only instance of the registry.
+   * 
+   * @return
+   * 		The one and only instance of the registry.
+   */
+  public static ErrorCustomizationRegistry getInstance()
+  {
+	if(registry == null)
+	{
+	  registry = new ErrorCustomizationRegistry();
+	}
+	return registry;
+  }
+  
+  /**
+   * Add a customizer to the registry. 
+   * 
+   * @param namespace
+   * 		The namespace the customizer will act on.
+   * @param customizer
+   * 		The error customizer to register.
+   */
+  public void addErrorMessageCustomizer(String namespace, IErrorMessageCustomizer customizer)
+  {
+	// To register a customizer for the no namespace use an empty string.
+	if(namespace == null)
+	{
+	  namespace = "";
+	}
+	List customizersForNS = (List)customizers.get(namespace);
+	if(customizersForNS == null)
+	{
+	  customizersForNS = new ArrayList();
+	  customizers.put(namespace, customizersForNS);
+	}
+	if(customizer != null)
+	{
+	  customizersForNS.add(customizer);
+	}
+  }
+  
+  /**
+   * Get the error customizers for a given namespace.
+   * 
+   * @param namespace
+   * 		The namespace for which to retrieve the customizers.
+   * @return
+   * 		An array of customizers registered for this namespace.
+   */
+  public IErrorMessageCustomizer[] getCustomizers(String namespace)
+  {
+	if(namespace == null)
+	{
+	  namespace = "";
+	}
+	List customizersForNS = (List)customizers.get(namespace);
+	if(customizersForNS == null)
+	{
+	  customizersForNS = new ArrayList();
+	}
+	return (IErrorMessageCustomizer[])customizersForNS.toArray(new IErrorMessageCustomizer[customizersForNS.size()]);
+  }
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
new file mode 100644
index 0000000..444d86d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/ErrorMessageCustomizerDelegate.java
@@ -0,0 +1,72 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.xml.core.internal.XMLCorePlugin;
+import org.osgi.framework.Bundle;
+
+/**
+ * An error message customizer delegate is used to allow for
+ * lazy loading of error customizers.
+ *
+ */
+public class ErrorMessageCustomizerDelegate implements IErrorMessageCustomizer
+{
+  protected Bundle bundle = null;
+  protected String classname = null;
+  protected IErrorMessageCustomizer customizer = null;
+  
+  public ErrorMessageCustomizerDelegate(Bundle bundle, String classname)
+  {
+	this.bundle = bundle;
+	this.classname = classname;
+  }
+
+  /* (non-Javadoc)
+   * @see org.eclipse.wst.xml.core.internal.validation.errorcustomization.IErrorMessageCustomizer#customizeMessage(org.eclipse.wst.xml.core.internal.validation.errorcustomization.ElementInformation, java.lang.String, java.lang.Object[])
+   */
+  public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments) 
+  {
+	if(customizer == null)
+	{
+	  loadCustomizer();
+	}
+	if(customizer == null)
+	{
+	  return null;
+	}
+	return customizer.customizeMessage(elementInfo, errorKey, arguments);
+  }
+  
+  /**
+   * Load the customizer class.
+   */
+  protected void loadCustomizer()
+  {
+	try
+	{
+	  Class customizerClass = bundle.loadClass(classname);
+	  customizer = (IErrorMessageCustomizer)customizerClass.newInstance();
+	}
+	catch(Exception e)
+	{
+	  XMLCorePlugin.getDefault().getLog().log(
+			  new Status(IStatus.WARNING, 
+					     XMLCorePlugin.getDefault().getBundle().getSymbolicName(), 
+					     IStatus.OK, 
+					     "The XML validator error customizer was unable to load class " + classname, e));
+	}
+  }
+  
+  
+}
diff --git a/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
new file mode 100644
index 0000000..ac6d1e0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.core/src-validation/org/eclipse/wst/xml/core/internal/validation/errorcustomization/IErrorMessageCustomizer.java
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.core.internal.validation.errorcustomization;
+
+/**
+ * An error message customizer will be called by the XML validator to customize
+ * XML validation errors for a given namespace. The customizer can be used to 
+ * create clearer errors for specific application domains.
+ */
+public interface IErrorMessageCustomizer 
+{
+  /**
+   * Return a customized error message for the given element. Null should be returned
+   * if the message should not be customized.
+   * 
+   * @param elementInformation
+   * 		The information about the element for which to customize the error.
+   * @param errorKey
+   * 		The key for the error for which to replace the message.
+   * @param arguments
+   * 		Arguments related the the error message.
+   * @return
+   * 		A customized error message or null if this customizer will not customize the message.
+   */
+  public String customizeMessage(ElementInformation elementInfo, String errorKey, Object[] arguments);
+}
diff --git a/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
index 695489e..8c3d7af 100644
--- a/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xml.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.xml.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.2.qualifier
 Bundle-Activator: org.eclipse.wst.xml.ui.internal.XMLUIPlugin
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
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
index 0f67568..1f3cb21 100644
--- 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
@@ -15,6 +15,7 @@
 
 import org.eclipse.wst.common.uriresolver.internal.provisional.URIResolverPlugin;
 import org.eclipse.wst.xml.core.internal.validation.XMLValidationReport;
+import org.eclipse.wst.xml.core.internal.validation.eclipse.ErrorCustomizationPluginRegistryReader;
 
 /**
  * An XML validator specific to Eclipse. This validator will wrap the internal
@@ -50,6 +51,7 @@
   {
     validator = new org.eclipse.wst.xml.core.internal.validation.XMLValidator();
     validator.setURIResolver(URIResolverPlugin.createResolver());
+    new ErrorCustomizationPluginRegistryReader().readRegistry();
   }
   /**
    * Validate the file at the given URI.
diff --git a/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ReplaceNameTemplateContext.java b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ReplaceNameTemplateContext.java
new file mode 100644
index 0000000..9eb98c4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xml.ui/src/org/eclipse/wst/xml/ui/internal/contentassist/ReplaceNameTemplateContext.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2006 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.xml.ui.internal.contentassist;
+
+import org.eclipse.jface.text.BadLocationException;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.Position;
+import org.eclipse.jface.text.templates.DocumentTemplateContext;
+import org.eclipse.jface.text.templates.Template;
+import org.eclipse.jface.text.templates.TemplateBuffer;
+import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+
+/**
+ * Just like DocumentTemplateContext except if an insert offset is passed in,
+ * during evaluation, the "prefix" before the template will be checked to see
+ * if it matches the template name. If so, overwrite the template name.
+ * Otherwise, just insert the template at the insert offset location (by not
+ * overwriting the prefix text)
+ */
+public class ReplaceNameTemplateContext extends DocumentTemplateContext {
+	private int fInsertOffset = -1;
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length) {
+		this(type, document, new Position(offset, length));
+	}
+
+	/**
+	 * Creates a document template context. The supplied <code>Position</code>
+	 * will be queried to compute the <code>getStart</code> and
+	 * <code>getEnd</code> methods, which will therefore answer updated
+	 * position data if it is registered with the document.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param position
+	 *            the position describing the area of the document which forms
+	 *            the template context
+	 * @since 3.1
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, Position position) {
+		super(type, document, position);
+	}
+
+	/**
+	 * Creates a document template context.
+	 * 
+	 * @param type
+	 *            the context type
+	 * @param document
+	 *            the document this context applies to
+	 * @param offset
+	 *            the offset of the document region
+	 * @param length
+	 *            the length of the document region
+	 * @param insertOffset
+	 *            the offset of the document region where insert was
+	 *            originally requested
+	 */
+	public ReplaceNameTemplateContext(TemplateContextType type, IDocument document, int offset, int length, int insertOffset) {
+		this(type, document, new Position(offset, length));
+		fInsertOffset = insertOffset;
+	}
+
+	/*
+	 * @see org.eclipse.jface.text.templates.TemplateContext#evaluate(org.eclipse.jface.text.templates.Template)
+	 */
+	public TemplateBuffer evaluate(Template template) throws BadLocationException, TemplateException {
+		TemplateBuffer buffer = super.evaluate(template);
+		if (buffer != null) {
+			if (fInsertOffset > -1 && fInsertOffset > getStart()) {
+				String prefix = getDocument().get(getStart(), fInsertOffset - getStart());
+				if (!template.getName().startsWith(prefix)) {
+					// generate a new buffer that actually contains the
+					// text that was going to be overwritten
+					buffer = new TemplateBuffer(prefix + buffer.getString(), buffer.getVariables());
+				}
+			}
+		}
+		return buffer;
+	}
+}
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
index 01068ba..32b40df 100644
--- 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
@@ -65,9 +65,20 @@
 	 * @param context
 	 */
 	private void addTemplates(ContentAssistRequest contentAssistRequest, String context) {
+		addTemplates(contentAssistRequest, context, contentAssistRequest.getReplacementBeginPosition());
+	}
+	
+	/**
+	 * Adds templates to the list of proposals
+	 * 
+	 * @param contentAssistRequest
+	 * @param context
+	 * @param startOffset
+	 */
+	private void addTemplates(ContentAssistRequest contentAssistRequest, String context, int startOffset) {
 		if (contentAssistRequest == null)
 			return;
-
+		
 		// if already adding template proposals for a certain context type, do
 		// not add again
 		if (!fTemplateContexts.contains(context)) {
@@ -76,7 +87,7 @@
 
 			if (getTemplateCompletionProcessor() != null) {
 				getTemplateCompletionProcessor().setContextType(context);
-				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, contentAssistRequest.getReplacementBeginPosition());
+				ICompletionProposal[] proposals = getTemplateCompletionProcessor().computeCompletionProposals(fTextViewer, startOffset);
 				for (int i = 0; i < proposals.length; ++i) {
 					if (useProposalList)
 						contentAssistRequest.addProposal(proposals[i]);
@@ -89,7 +100,8 @@
 	
 	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);
+		// bug115927 use original document position for all/any region templates
+		addTemplates(request, TemplateContextTypeIdsXML.ALL, documentPosition);
 		return request;
 	}
 	
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
index a789a47..619bcae 100644
--- 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
@@ -12,14 +12,24 @@
  *******************************************************************************/
 package org.eclipse.wst.xml.ui.internal.contentassist;
 
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+
+import org.eclipse.jface.text.IDocument;
 import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextSelection;
 import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
 import org.eclipse.jface.text.contentassist.ICompletionProposal;
 import org.eclipse.jface.text.templates.ContextTypeRegistry;
 import org.eclipse.jface.text.templates.Template;
 import org.eclipse.jface.text.templates.TemplateCompletionProcessor;
 import org.eclipse.jface.text.templates.TemplateContext;
 import org.eclipse.jface.text.templates.TemplateContextType;
+import org.eclipse.jface.text.templates.TemplateException;
+import org.eclipse.jface.text.templates.TemplateProposal;
 import org.eclipse.jface.text.templates.persistence.TemplateStore;
 import org.eclipse.swt.graphics.Image;
 import org.eclipse.wst.xml.ui.internal.XMLUIPlugin;
@@ -35,8 +45,88 @@
  * templates.
  */
 class XMLTemplateCompletionProcessor extends TemplateCompletionProcessor {
+	private static final class ProposalComparator implements Comparator {
+		public int compare(Object o1, Object o2) {
+			return ((TemplateProposal) o2).getRelevance() - ((TemplateProposal) o1).getRelevance();
+		}
+	}
+
+	private static final Comparator fgProposalComparator = new ProposalComparator();
 	private String fContextTypeId = null;
 
+	/*
+	 * Copied from super class except instead of calling createContext(viewer,
+	 * region) call createContext(viewer, region, offset) instead
+	 */
+	public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
+
+		ITextSelection selection = (ITextSelection) viewer.getSelectionProvider().getSelection();
+
+		// adjust offset to end of normalized selection
+		if (selection.getOffset() == offset)
+			offset = selection.getOffset() + selection.getLength();
+
+		String prefix = extractPrefix(viewer, offset);
+		Region region = new Region(offset - prefix.length(), prefix.length());
+		TemplateContext context = createContext(viewer, region, offset);
+		if (context == null)
+			return new ICompletionProposal[0];
+
+		context.setVariable("selection", selection.getText()); // name of the
+																// selection
+																// variables
+																// {line,
+																// word}_selection
+																// //$NON-NLS-1$
+
+		Template[] templates = getTemplates(context.getContextType().getId());
+
+		List matches = new ArrayList();
+		for (int i = 0; i < templates.length; i++) {
+			Template template = templates[i];
+			try {
+				context.getContextType().validate(template.getPattern());
+			}
+			catch (TemplateException e) {
+				continue;
+			}
+			if (template.matches(prefix, context.getContextType().getId()))
+				matches.add(createProposal(template, context, (IRegion) region, getRelevance(template, prefix)));
+		}
+
+		Collections.sort(matches, fgProposalComparator);
+
+		return (ICompletionProposal[]) matches.toArray(new ICompletionProposal[matches.size()]);
+	}
+
+	/**
+	 * Creates a concrete template context for the given region in the
+	 * document. This involves finding out which context type is valid at the
+	 * given location, and then creating a context of this type. The default
+	 * implementation returns a <code>SmartReplaceTemplateContext</code> for
+	 * the context type at the given location. This takes the offset at which
+	 * content assist was invoked into consideration.
+	 * 
+	 * @param viewer
+	 *            the viewer for which the context is created
+	 * @param region
+	 *            the region into <code>document</code> for which the
+	 *            context is created
+	 * @param offset
+	 *            the original offset where content assist was invoked
+	 * @return a template context that can handle template insertion at the
+	 *         given location, or <code>null</code>
+	 */
+	private TemplateContext createContext(ITextViewer viewer, IRegion region, int offset) {
+		// pretty much same code as super.createContext except create SmartReplaceTemplateContext
+		TemplateContextType contextType = getContextType(viewer, region);
+		if (contextType != null) {
+			IDocument document = viewer.getDocument();
+			return new ReplaceNameTemplateContext(contextType, document, region.getOffset(), region.getLength(), offset);
+		}
+		return null;
+	}
+	
 	protected ICompletionProposal createProposal(Template template, TemplateContext context, IRegion region, int relevance) {
 		return new CustomTemplateProposal(template, context, region, getImage(template), relevance);
 	}
diff --git a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
similarity index 62%
rename from development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs
rename to bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
index c1373fb..6cdb4d2 100644
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.jdt.core.prefs
+++ b/bundles/org.eclipse.wst.xsd.core/.settings/org.eclipse.jdt.core.prefs
@@ -1,50 +1,50 @@
-#Mon May 30 19:10:44 EDT 2005
+#Mon Jan 30 18:54:33 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.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=enabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
-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.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=warning
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
+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=error
+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=warning
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=enabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=error
+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=warning
+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=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=error
+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.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
@@ -54,5 +54,4 @@
 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.incompatibleJDKLevel=ignore
-org.eclipse.jdt.core.incompleteClasspath=error
+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
index 6e4ed9f..390939c 100644
--- a/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xsd.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %_UI_PLUGIN_NAME
 Bundle-SymbolicName: org.eclipse.wst.xsd.core; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.1.qualifier
 Bundle-Activator: org.eclipse.wst.xsd.core.internal.XSDCorePlugin
 Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
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
index a346aa0..f16d9c0 100644
--- 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
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * 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
@@ -10,159 +10,102 @@
  *******************************************************************************/
 package org.eclipse.wst.xsd.core.internal.validation;
 
-import java.io.BufferedReader;
 import java.io.IOException;
 import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.StringReader;
-import java.net.URL;
 
-import org.apache.xerces.parsers.SAXParser;
+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.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-import org.xml.sax.XMLReader;
+import org.w3c.dom.DOMError;
 
 /**
  * The XSDValidator will validate XSD files.
- * 
- * @author Lawrence Mandel, IBM
  */
 public class XSDValidator
 {
-
-  private final String XML_INSTANCE_DOC_TOP = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + "<root \n"   //$NON-NLS-1$//$NON-NLS-2$
-  + "  xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n"; //$NON-NLS-1$
-
-  private final String XML_INSTANCE_DOC_MID = " xsi:noNamespaceSchemaLocation=\""; //$NON-NLS-1$
-
-  private final String XML_INSTANCE_DOC_BOT = "\">\n" + "</root>\n";  //$NON-NLS-1$//$NON-NLS-2$
-
-  private final String DUMMY_URI = "http://example.org/dummy"; //$NON-NLS-1$
-  
   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);
-    try
-    {
-      String ns = null;
-      String schemaLocationString = "";
+	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);
+	    }
+	  }
 
-      URL url = new URL(uri);
-      if (url != null)
-      {
-        BufferedReader bufreader = new BufferedReader(new InputStreamReader(url.openStream()));
-
-        if (bufreader != null)
-        {
-          StringBuffer source = new StringBuffer();
-          while (bufreader.ready())
-          {
-            source.append(bufreader.readLine());
-          }
-          bufreader.close();
-          int tn = source.indexOf("targetNamespace");
-          if (tn != -1)
-          {
-            int firstquote = source.indexOf("\"", tn) + 1;
-            int secondquote = source.indexOf("\"", firstquote);
-            ns = source.substring(firstquote, secondquote);
-          }
-        }
-        bufreader.close();
+	  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);
       }
-
-      XSDErrorHandler errorHandler = new XSDErrorHandler(valinfo);
-      try
-      {
-        StringBuffer instanceDoc = new StringBuffer(XML_INSTANCE_DOC_TOP);
-        if (ns != null && !ns.equals(""))
-        {
-          instanceDoc.append(" xmlns=\"").append(ns).append("\"\n");
-          instanceDoc.append(" xsi:schemaLocation=\"");
-          instanceDoc.append(ns);
-          instanceDoc.append(" ");
-        } else
-        {
-          instanceDoc.append(XML_INSTANCE_DOC_MID);
-        }
-        instanceDoc.append(uri.replaceAll(" ", "%20"));
-        if (!schemaLocationString.equals(""))
-        {
-          instanceDoc.append(" ").append(schemaLocationString);
-        }
-        instanceDoc.append(XML_INSTANCE_DOC_BOT);
-        InputSource is = new InputSource(new StringReader(instanceDoc.toString()));
-        is.setSystemId(DUMMY_URI);
-
-        String soapFile = "platform:/plugin/org.eclipse.wst.wsdl.validation./xsd/xml-soap.xsd";
-        XMLReader reader = new SAXParser();
-        try
-        {
-          reader.setFeature("http://apache.org/xml/features/continue-after-fatal-error", false);
-          reader.setFeature("http://xml.org/sax/features/namespaces", true);
-          reader.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
-          reader.setFeature("http://xml.org/sax/features/validation", true);
-          reader.setFeature("http://apache.org/xml/features/validation/schema", true);
-          reader.setFeature("http://apache.org/xml/features/validation/schema-full-checking", true);
-          reader.setFeature("http://xml.org/sax/features/external-general-entities", true);
-          reader.setFeature("http://xml.org/sax/features/external-parameter-entities", true);
-          reader.setFeature("http://apache.org/xml/features/validation/warn-on-duplicate-attdef", true);
-
-          reader.setProperty("http://apache.org/xml/properties/schema/external-schemaLocation", 
-          		"http://xml.apache.org/xml-soap " + soapFile);
-          reader.setErrorHandler(errorHandler);
-
-          if (uriresolver != null)
-          {
-            XSDEntityResolver resolver = new XSDEntityResolver(uriresolver, uri, inputStream);
-            try
-            {
-              reader.setProperty("http://apache.org/xml/properties/internal/entity-resolver", resolver);
-            }
-            catch (Exception e)
-            {
-              // TODO: log failure to register the entity resolver.
-            }
-          }
-
-          reader.parse(is);
-
-        } catch (SAXException e)
-        {
-          //LoggerFactory.getLoggerInstance().logError("XSD Validator Exception: ", e);
-        }
-      } catch (IOException except)
-      {
-        //LoggerFactory.getLoggerInstance().logError("XSD Validator Exception: ", except);
-      }
-    } catch (Exception e)
-    { 
-      //LoggerFactory.getLoggerInstance().logError("XSD Validator Exception: ", e);
-    }
-
-    return valinfo;
+	}
+	catch (Exception e)
+	{
+      // TODO: log error.
+	  //System.out.println(e);
+	}
+	return valinfo;
   }
 
   /**
@@ -179,16 +122,10 @@
   /**
    * The XSDErrorHandler handle Xerces parsing errors and puts the errors
    * into the given ValidationInfo object.
-   * 
-   * @author Lawrence Mandel, IBM
    */
-  protected class XSDErrorHandler implements org.xml.sax.ErrorHandler
+  protected class XSDErrorHandler implements XMLErrorHandler
   {
-
-    private final int ERROR = 0;
-
-    private final int WARNING = 1;
-
+	  
     private final ValidationInfo valinfo;
 
     public XSDErrorHandler(ValidationInfo valinfo)
@@ -199,57 +136,49 @@
     /**
      * 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(SAXParseException exception, int severity)
+    protected void addValidationMessage(String errorKey, XMLParseException exception, int severity)
     { 
-      // get the error key by taking the substring of what is before the ':' in the error message:
-      String errorKey = exception.getLocalizedMessage();
-      if (errorKey != null)
+      String systemId = exception.getExpandedSystemId();
+      if (systemId != null)
       {
-        int index = errorKey.indexOf(':');
-        if (index != -1)
-        { errorKey = errorKey.substring(0, index);
-        }
-      }
-      
-      if (exception.getSystemId() != null && !exception.getSystemId().equals(DUMMY_URI))
-      {
-        if (severity == WARNING)
+        if (severity == DOMError.SEVERITY_WARNING)
         {
-          valinfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId());
+          valinfo.addWarning(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), systemId);
         }
         else
         {
-          valinfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), exception.getSystemId(), errorKey, null);
+          valinfo.addError(exception.getLocalizedMessage(), exception.getLineNumber(), exception.getColumnNumber(), systemId, errorKey, null);
         }
       }
     }
 
     /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#error(org.xml.sax.SAXParseException)
+     * @see org.apache.xerces.xni.parser.XMLErrorHandler#warning(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
      */
-    public void error(SAXParseException exception) throws SAXException
-    {
-      addValidationMessage(exception, ERROR);
-    }
+    public void warning(String domain, String key, XMLParseException exception) throws XNIException
+	{
+    	addValidationMessage(key, exception, DOMError.SEVERITY_WARNING);
+	}
 
     /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#fatalError(org.xml.sax.SAXParseException)
+     * @see org.apache.xerces.xni.parser.XMLErrorHandler#error(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
      */
-    public void fatalError(SAXParseException exception) throws SAXException
+    public void error(String domain, String key, XMLParseException exception) throws XNIException
     {
-      addValidationMessage(exception, ERROR);
-    }
+    	addValidationMessage(key, exception, DOMError.SEVERITY_ERROR);
+	}
 
     /* (non-Javadoc)
-     * @see org.xml.sax.ErrorHandler#warning(org.xml.sax.SAXParseException)
+     * @see org.apache.xerces.xni.parser.XMLErrorHandler#fatalError(java.lang.String, java.lang.String, org.apache.xerces.xni.parser.XMLParseException)
      */
-    public void warning(SAXParseException exception) throws SAXException
-    {
-      addValidationMessage(exception, WARNING);
-    }
+    public void fatalError(String domain, String key, XMLParseException exception) throws XNIException
+	{
+    	addValidationMessage(key, exception, DOMError.SEVERITY_FATAL_ERROR);
+	}
   }
 
   /**
@@ -260,8 +189,6 @@
   {
     private URIResolver uriresolver = null;
 
-    private InputStream inputStream;
-
     /**
      * Constructor.
      * 
@@ -269,10 +196,9 @@
      *          The idresolver this entity resolver wraps.
      * @param baselocation The base location to resolve with.
      */
-    public XSDEntityResolver(URIResolver uriresolver, String baselocation, InputStream inputStream)
+    public XSDEntityResolver(URIResolver uriresolver, String baselocation)
     {
       this.uriresolver = uriresolver;
-      this.inputStream = inputStream;
     }
     
     /* (non-Javadoc)
@@ -280,23 +206,17 @@
      */
     public XMLInputSource resolveEntity(XMLResourceIdentifier resourceIdentifier) throws XNIException, IOException
     {
-      // consider the resourceIdentifier's fields to see we're actually in the dummy xml file
-      // and if this is the reference to the schema we want to validate
-      // ... if so return an XMLInputSource built from the dirty copy of the schema
-      boolean isDummyXML = DUMMY_URI.equals(resourceIdentifier.getBaseSystemId());
-      if (isDummyXML && inputStream != null)
+      String literalSystemId = resourceIdentifier.getLiteralSystemId();
+      if(literalSystemId != null)
       {
-        XMLInputSource inputSource = new XMLInputSource(null, resourceIdentifier.getLiteralSystemId(), null, inputStream, null);
-        return inputSource;
+    	resourceIdentifier.setLiteralSystemId(literalSystemId.replace('\\','/'));
       }
-      else
-      {
         // 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.ui/.classpath b/bundles/org.eclipse.wst.xsd.ui/.classpath
index 905c508..ed58bc2 100644
--- a/bundles/org.eclipse.wst.xsd.ui/.classpath
+++ b/bundles/org.eclipse.wst.xsd.ui/.classpath
@@ -2,7 +2,6 @@
 <classpath>
 	<classpathentry kind="src" path="src"/>
 	<classpathentry kind="src" path="src-validation"/>
-	<classpathentry kind="src" path="src-refactor"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
 	<classpathentry kind="output" path="bin"/>
diff --git a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
index 5c9f5f4..91c80fe 100644
--- a/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.wst.xsd.ui/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %_UI_PLUGIN_NAME
 Bundle-SymbolicName: org.eclipse.wst.xsd.ui; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Activator: org.eclipse.core.internal.compatibility.PluginActivator
 Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
@@ -27,6 +27,7 @@
  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,
@@ -38,7 +39,6 @@
  org.eclipse.wst.common.uriresolver,
  org.eclipse.wst.sse.ui,
  org.eclipse.wst.sse.core,
- org.eclipse.wst.common.core,
  org.eclipse.wst.xml.core,
  org.eclipse.wst.xml.ui,
  org.eclipse.wst.common.ui,
diff --git a/bundles/org.eclipse.wst.xsd.ui/plugin.xml b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
index 3c506ac..564798d 100644
--- a/bundles/org.eclipse.wst.xsd.ui/plugin.xml
+++ b/bundles/org.eclipse.wst.xsd.ui/plugin.xml
@@ -296,145 +296,4 @@
 		</validator>
 	</extension>
 
-	<!-- ============================================================================== -->
-	<!-- Register the XSDSearchParticpant against for XMLComponentSearchPatterns 		-->
-	<!-- ============================================================================== -->	
-	 <extension   
-		point="org.eclipse.wst.common.core.searchParticipants">
-		<searchParticipant
-			id="org.eclipse.wst.xsd.search.XSDSearchParticipant"
-			class="org.eclipse.wst.xsd.ui.internal.search.XSDSearchParticipant">
-			<enablement>
-			   <or>
-			      <with variable="pattern">
-					<instanceof value="org.eclipse.wst.xml.core.internal.search.XMLComponentSearchPattern"/>			   
-				  </with>
-				</or>
-			</enablement>
-			 <contentTypeBinding
-                contentTypeId="org.eclipse.wst.xsd.core.xsdsource" />
-		</searchParticipant>
-	 </extension>
-	
-	<!-- ============================================================================== -->	 
-    <!-- Register a 'rename' participant this enables us to provide refactoring for     --> 
-    <!-- renamed XML Schema components (e.g. elements, types etc.)                      --> 
-	<!-- ============================================================================== -->	 
-	<extension
-		point="org.eclipse.ltk.core.refactoring.renameParticipants">
-		<renameParticipant
-			name="%xsd.resource.rename.participant.name"
-			class="org.eclipse.wst.xsd.ui.internal.refactor.rename.XSDComponentRenameParticipant"
-			id="org.eclipse.wst.xsd.refactoring.XSDComponentRenameParticipant">
-			<enablement>
-				<with variable="element">
-					<instanceof
-						value="org.eclipse.xsd.XSDNamedComponent">
-					</instanceof>
-				</with>
-			</enablement>
-		</renameParticipant>
-		
-	</extension>
-	
-
-	<!-- ============================================================================== -->	 
-    <!-- Register a 'rename' participant this enables us to provide refactoring for     --> 
-    <!-- renamed resources.                                                             --> 
-	<!-- ============================================================================== -->	 
-    <extension
-		point="org.eclipse.ltk.core.refactoring.renameParticipants">
-		<renameParticipant
-			name="%xsd.resource.rename.participant.name"
-			class="org.eclipse.wst.xsd.ui.internal.refactor.rename.ResourceRenameParticipant"
-			id="org.eclipse.wst.xsd.refactoring.XSDResourceRenameParticipant">
-			<enablement>
-				<with variable="element">
-					<instanceof value="org.eclipse.core.resources.IResource"/>
-				</with>
-			</enablement>
-		</renameParticipant>
-	</extension>
-	
-	
-   <extension point="org.eclipse.ui.popupMenus"> 
-      <objectContribution 
-         id="org.eclipse.wst.xsd.ui.refactoring.menu.objectContrib" 
-         objectClass="org.eclipse.xsd.XSDComponent"> 
-         <action
-            id="org.eclipse.wst.xsd.ui.refactoring.menu.refactorGroup.object" 
-            enablesFor="1"
-            style="pulldown"
-            menubarPath="additions"
-            label="%refactoring.menu.label" 
-            class="org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorGroupActionDelegate"> 
-         </action> 
-      </objectContribution> 
- 
-   
-    <viewerContribution
-        id="org.eclipse.wst.xsd.ui.refactoring.menu.source"
-        targetID="org.eclipse.wst.xsd.core.xsdsource.source.EditorContext">
-	    <action id="org.eclipse.wst.xsd.ui.refactoring.menu.refactorGroup.source"
-       		style="pulldown"
-            menubarPath="additions"
-            label="%refactoring.menu.label" 
-            class="org.eclipse.wst.xsd.ui.internal.refactor.actions.XSDRefactorGroupActionDelegate"> 
-  	    </action>
-       </viewerContribution>
-       
-     </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>
-		<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>
-		<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>
-		<command
-			name="%command.xsd.refactor.renameTargetNamespace.name"
-			description="%command.xsd.refactor.renameTargetNamespace.description"
-			categoryId="org.eclipse.ui.category.edit"
-			id="org.eclipse.wst.xsd.ui.refactor.renameTargetNamespace">
-		</command>
-	</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-->	
-
 </plugin>
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
index 50f2e5b..3c90b21 100644
--- 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
@@ -14,6 +14,7 @@
 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;
@@ -38,6 +39,7 @@
 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
 {
@@ -51,7 +53,7 @@
 
   protected RetargetAction retargetReloadDependenciesAction;
   private RetargetTextEditorAction renameElementAction = null;
-  //private IMenuManager refactorMenu = null;
+  private IMenuManager refactorMenu = null;
  
   /**
    * Constructor for XSDActionBarContributor.
@@ -75,8 +77,8 @@
 	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);
+	refactorMenu = new MenuManager(XSDEditorPlugin.getXSDString("refactoring.menu.label"), RefactorActionGroup.MENU_ID); //TODO: externalize string
+	refactorMenu.add(this.renameElementAction);
   }
 
   protected void updateActions()
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
index d003bfa..61093be 100644
--- 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
@@ -11,6 +11,7 @@
 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;
@@ -22,6 +23,7 @@
 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;
@@ -42,6 +44,7 @@
 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;
@@ -64,7 +67,7 @@
   protected XSDSchema xsdSchema;
   protected boolean isReadOnly;
   protected Object sourceContext;
-  //private RefactorActionGroup fRefactorMenuGroup;
+  private RefactorActionGroup fRefactorMenuGroup;
 
   /**
    * Constructor for XSDMenuListener.
@@ -1672,13 +1675,11 @@
   }
   
   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)
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
index 5495c98..d2e4c23 100644
--- 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
@@ -11,6 +11,7 @@
 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;
@@ -19,10 +20,26 @@
 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;
 
@@ -144,7 +161,6 @@
   protected boolean cleanupReferences(Node deletedNode)
   {
     boolean refresh = false;
-    /*
     XSDConcreteComponent comp = getSchema().getCorrespondingComponent(deletedNode);
     
     if (comp instanceof XSDInclude ||
@@ -211,7 +227,7 @@
       {
         cleanHelper.visitSchema(getSchema());
       }
-    }*/
+    }
     return refresh;
   }
 
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
index 29946b2..a5b8e17 100644
--- 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
@@ -14,6 +14,7 @@
 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;
@@ -22,7 +23,7 @@
 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.rename.XSDExternalFileCleanup;
+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;
@@ -235,14 +236,14 @@
         // 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
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
index 03c23e6..5f25abc 100644
--- 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
@@ -14,7 +14,14 @@
 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;
 
 
 
@@ -50,10 +57,8 @@
       this.name = name;
     }                                                              
 
-    public void run()       
-    { 
-      //TODO cs : revisit
-      /*                            
+    public void run()
+    {                             
       XSDSwitch xsdSwitch = new XSDSwitch()
       {                   
         public Object caseXSDTypeDefinition(XSDTypeDefinition object)
@@ -77,7 +82,7 @@
           return null;
         }
       };
-      xsdSwitch.doSwitch(component);*/ 
+      xsdSwitch.doSwitch(component); 
       component.setName(name);
       if (mySource instanceof TopLevelComponentEditPart)
       {
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
index b6413fe..0365346 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
@@ -19,6 +20,7 @@
 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;
@@ -221,9 +223,8 @@
           {
             XSDAttributeDeclaration xsdAttributeDeclaration = (XSDAttributeDeclaration)comp;
             xsdAttributeDeclaration.setName((String)value);
-            //TODO : cs revisit
-            //GlobalAttributeRenamer renamer = new GlobalAttributeRenamer(xsdAttributeDeclaration, (String)value);
-            //renamer.visitSchema(xsdSchema);
+            GlobalAttributeRenamer renamer = new GlobalAttributeRenamer(xsdAttributeDeclaration, (String)value);
+            renamer.visitSchema(xsdSchema);
           }
         }
         element.setAttribute(XSDConstants.NAME_ATTRIBUTE, (String)value);
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
index aa358e6..0e759c1 100644
--- 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
@@ -12,15 +12,18 @@
 
 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;
@@ -219,9 +222,8 @@
               {
 //                XSDComplexTypeDefinition ct = (XSDComplexTypeDefinition)comp;
 //                ct.setName(newValue);
-                //TODO : cs revisit
-                //GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
-                //renamer.visitSchema(xsdSchema);
+                GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, newValue);
+                renamer.visitSchema(xsdSchema);
               }
             }
             element.setAttribute(XSDConstants.NAME_ATTRIBUTE, newValue);
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
index 0dfda24..06e9ef7 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 9f21082..65416ac 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
@@ -19,9 +20,12 @@
 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;
@@ -326,13 +330,11 @@
           if (xsdSchema != null)
           {
             XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-            
-            // TODO cs : revisit
-            //if (comp != null && comp instanceof XSDElementDeclaration && comp.getContainer().equals(xsdSchema))
-            //{
-              //GlobalElementRenamer renamer = new GlobalElementRenamer((XSDNamedComponent)comp, newValue);
-              //renamer.visitSchema(xsdSchema);
-            //}
+            if (comp != null && comp instanceof XSDElementDeclaration && comp.getContainer().equals(xsdSchema))
+            {
+              GlobalElementRenamer renamer = new GlobalElementRenamer((XSDNamedComponent)comp, newValue);
+              renamer.visitSchema(xsdSchema);
+            }
           }
         }
       }
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
index 31b7d35..65124f7 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index ffe87ae..0067c48 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 6172f69..cadd611 100644
--- 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
@@ -13,6 +13,7 @@
 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;
@@ -22,7 +23,7 @@
 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.rename.XSDExternalFileCleanup;
+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;
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
index d1e9e12..b5054ac 100644
--- 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
@@ -12,13 +12,14 @@
 
 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.rename.XSDExternalFileCleanup;
+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;
@@ -161,7 +162,7 @@
 
       XSDSchema referencedSchema = include.getResolvedSchema();
       if (referencedSchema != null)
-      {        
+      {
         XSDExternalFileCleanup cleanHelper = new XSDExternalFileCleanup(referencedSchema);
         cleanHelper.visitSchema(xsdSchema);
         
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
index f4fcab1..19e95ce 100644
--- 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
@@ -13,6 +13,7 @@
 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;
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
index 728e613..228860c 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 9c31405..bbfb786 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
@@ -19,8 +20,13 @@
 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;
 
@@ -137,13 +143,11 @@
           if (xsdSchema != null)
           {
             XSDConcreteComponent comp = xsdSchema.getCorrespondingComponent(element);
-            
-            // TODO cs : revisit
-            //if (comp != null && comp instanceof XSDAttributeGroupDefinition && comp.getContainer().equals(xsdSchema))
-            //{
-            //  GlobalAttributeGroupRenamer renamer = new GlobalAttributeGroupRenamer((XSDNamedComponent)comp, (String)value);
-            //  renamer.visitSchema(xsdSchema);
-            //}
+            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);
@@ -188,13 +192,12 @@
             // now rename any references to this element
             if (xsdSchema != null)
              {
-              // TODO cs : revisit
-              //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);
-              //}
+              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);
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
index 829e192..573d83d 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index c437e4c..38f166a 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 46ca063..0f5cb7f 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 0ae4888..2d8b402 100644
--- 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
@@ -15,6 +15,7 @@
 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;
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
index 9df52c1..6b33262 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 49124a9..4d07c0b 100644
--- 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
@@ -13,6 +13,7 @@
 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;
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
index 17c4bef..b49ceb1 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 12d5da9..99885fa 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
@@ -19,8 +20,10 @@
 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;
@@ -153,9 +156,8 @@
             if (comp != null && comp instanceof XSDSimpleTypeDefinition && comp.getContainer().equals(xsdSchema))
             {
 //                ((XSDNamedComponent)comp).setName(name);
-              // TODO CS : revisit
-              //GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, name);
-              //renamer.visitSchema(xsdSchema);
+              GlobalSimpleOrComplexTypeRenamer renamer = new GlobalSimpleOrComplexTypeRenamer((XSDNamedComponent)comp, name);
+              renamer.visitSchema(xsdSchema);
             }
           }
           element.setAttribute(XSDConstants.NAME_ATTRIBUTE, name);
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
index d66b32c..68584b4 100644
--- 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
@@ -13,6 +13,7 @@
 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;
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
index 961be94..60e238a 100644
--- 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
@@ -11,6 +11,7 @@
 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;
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
index 829dc16..9a5d893 100644
--- 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
@@ -12,6 +12,7 @@
 
 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;
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
index 1bcfb2d..b4d9cc2 100644
--- 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
@@ -11,6 +11,7 @@
 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;
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
index 28c9abf..95ebbe3 100644
--- 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
@@ -20,11 +20,20 @@
 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;
@@ -225,8 +234,6 @@
 
 	private void doReferentialIntegrityCheck(XSDComponent xsdComponent, String newValue)
 	{
-    }
-/*    
     Element element = xsdComponent.getElement();
     if (XSDDOMHelper.inputEquals(element, XSDConstants.ELEMENT_ELEMENT_TAG, false))
     {
@@ -394,7 +401,7 @@
     
 
 
-	}*/
+	}
 
   boolean checkForAnonymousType(Element element)
   {
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
index 7d4d06f..91a1924 100644
--- 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
@@ -11,6 +11,7 @@
 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;
@@ -33,7 +34,7 @@
 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.rename.XSDExternalFileCleanup;
+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;
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
new file mode 100644
index 0000000..7b56d8d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/RefactoringMessages.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..24bda3f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/XSDVisitor.java
@@ -0,0 +1,217 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..6404b3d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeAnonymousTypeGlobalAction.java
@@ -0,0 +1,162 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..ced71d7
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/MakeLocalElementGlobalAction.java
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..f260bb4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RefactorActionGroup.java
@@ -0,0 +1,261 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..c9c6178
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameAction.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..01527c0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameComponentAction.java
@@ -0,0 +1,139 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..cfa535b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceAction.java
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..f008e13
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/RenameResourceActionDelegate.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..abe853d
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/actions/SelectionDispatchAction.java
@@ -0,0 +1,199 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..f45a1e2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseCleanup.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..6503971
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/BaseGlobalCleanup.java
@@ -0,0 +1,29 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..2ff9b55
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeCleanup.java
@@ -0,0 +1,104 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..f858427
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalAttributeGroupCleanup.java
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..9719e39
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalElementCleanup.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..9486ff2
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalGroupCleanup.java
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..ed4132c
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/GlobalSimpleOrComplexTypeCleanup.java
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..aa40416
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/delete/XSDExternalFileCleanup.java
@@ -0,0 +1,299 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..5432863
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/messages.properties
@@ -0,0 +1,33 @@
+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/BaseRenamer.java b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java
new file mode 100644
index 0000000..1a789e8
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/BaseRenamer.java
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..678c77f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ComponentRenameChange.java
@@ -0,0 +1,193 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..d01ec4f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeGroupRenamer.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..d1b3e68
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalAttributeRenamer.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..869d775
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalElementRenamer.java
@@ -0,0 +1,41 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..b29b8e4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalGroupRenamer.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..63e4a67
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/GlobalSimpleOrComplexTypeRenamer.java
@@ -0,0 +1,91 @@
+/*******************************************************************************
+ * Copyright (c) 2001, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is 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
new file mode 100644
index 0000000..7aa495e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/INameUpdating.java
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.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
new file mode 100644
index 0000000..7d1cf38
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameComponentProcessor.java
@@ -0,0 +1,227 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..c072b5e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameInputWizardPage.java
@@ -0,0 +1,253 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..4a31f2e
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameRefactoringWizard.java
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..fd326c4
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameResourceProcessor.java
@@ -0,0 +1,170 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..a923f3f
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/RenameSupport.java
@@ -0,0 +1,205 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..c232e2b
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameChange.java
@@ -0,0 +1,107 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..e469981
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/rename/ResourceRenameParticipant.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2005 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ * 
+ * Contributors:
+ *     IBM Corporation - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.wst.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
index 3ecd3a3..35e90a3 100644
--- 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
@@ -12,7 +12,9 @@
 
 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;
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
index 8635ec2..ef996b1 100644
--- 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
@@ -11,7 +11,9 @@
 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;
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
new file mode 100644
index 0000000..80a6ac0
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalChange.java
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * 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
new file mode 100644
index 0000000..d94fd26
--- /dev/null
+++ b/bundles/org.eclipse.wst.xsd.ui/src/org/eclipse/wst/xsd/ui/internal/refactor/structure/MakeTypeGlobalProcessor.java
@@ -0,0 +1,219 @@
+/*******************************************************************************
+ * 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/development/org.eclipse.wst.sse.unittests/.classpath b/development/org.eclipse.wst.sse.unittests/.classpath
deleted file mode 100644
index 751c8f2..0000000
--- a/development/org.eclipse.wst.sse.unittests/.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/development/org.eclipse.wst.sse.unittests/.cvsignore b/development/org.eclipse.wst.sse.unittests/.cvsignore
deleted file mode 100644
index a37b9c5..0000000
--- a/development/org.eclipse.wst.sse.unittests/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-build.properties
-build.xml
-ssejunit.jar
-temp.folder
diff --git a/development/org.eclipse.wst.sse.unittests/.project b/development/org.eclipse.wst.sse.unittests/.project
deleted file mode 100644
index e6f5109..0000000
--- a/development/org.eclipse.wst.sse.unittests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>org.eclipse.wst.sse.unittests</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/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.pde.prefs b/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.pde.prefs
deleted file mode 100644
index 498dec4..0000000
--- a/development/org.eclipse.wst.sse.unittests/.settings/org.eclipse.pde.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Fri May 27 23:41:23 EDT 2005
-compilers.p.illegal-att-value=0
-compilers.p.no-required-att=0
-compilers.p.unknown-attribute=0
-compilers.p.unknown-class=0
-compilers.p.unknown-element=0
-compilers.p.unknown-resource=0
-compilers.p.unresolved-ex-points=0
-compilers.p.unresolved-import=0
-compilers.p.unused-element-or-attribute=0
-compilers.use-project=true
-eclipse.preferences.version=1
diff --git a/development/org.eclipse.wst.sse.unittests/META-INF/MANIFEST.MF b/development/org.eclipse.wst.sse.unittests/META-INF/MANIFEST.MF
deleted file mode 100644
index 20c3b77..0000000
--- a/development/org.eclipse.wst.sse.unittests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,37 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: Unittests
-Bundle-SymbolicName: org.eclipse.wst.sse.unittests; singleton:=true
-Bundle-Version: 0.7.0
-Bundle-ClassPath: sseunittests.jar
-Bundle-Vendor: Eclipse.org
-Bundle-Localization: plugin
-Export-Package: org.eclipse.wst.sse.unittests
-Require-Bundle: org.junit,
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jst.jsp.core.tests,
- org.eclipse.jst.jsp.tests.encoding,
- org.eclipse.jst.jsp.ui.tests,
- org.eclipse.jst.jsp.ui.tests.performance,
- org.eclipse.wst.css.core.tests,
- org.eclipse.wst.css.tests.encoding,
- org.eclipse.wst.css.ui.tests.performance,
- org.eclipse.wst.dtd.ui.tests,
- org.eclipse.wst.html.core.tests,
- org.eclipse.wst.html.tests.encoding,
- org.eclipse.wst.html.ui.tests,
- org.eclipse.wst.html.ui.tests.performance,
- org.eclipse.wst.sse.core.tests,
- org.eclipse.wst.sse.ui.tests,
- org.eclipse.wst.sse.ui.tests.performance,
- org.eclipse.wst.xml.core.tests,
- org.eclipse.wst.xml.tests.encoding,
- org.eclipse.wst.xml.ui.tests,
- org.eclipse.wst.xml.ui.tests.performance,
- org.eclipse.wst.xml.validation.tests,
- org.eclipse.wst.xml.ui,
- org.eclipse.wst.javascript.ui,
- org.eclipse.wst.xsd.validation.tests,
- org.eclipse.wst.css.ui.tests,
- org.eclipse.wst.sse.ui
diff --git a/development/org.eclipse.wst.sse.unittests/icons/sourceEditor.gif b/development/org.eclipse.wst.sse.unittests/icons/sourceEditor.gif
deleted file mode 100644
index 75ebdb8..0000000
--- a/development/org.eclipse.wst.sse.unittests/icons/sourceEditor.gif
+++ /dev/null
Binary files differ
diff --git a/development/org.eclipse.wst.sse.unittests/plugin.xml b/development/org.eclipse.wst.sse.unittests/plugin.xml
deleted file mode 100644
index c869906..0000000
--- a/development/org.eclipse.wst.sse.unittests/plugin.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
-        <extension point="org.eclipse.ui.editors">
-                <editor
-                        name="%XML_Source_Page_Editor.name"
-                        icon="icons/sourceEditor.gif"
-                        contributorClass="org.eclipse.wst.xml.ui.internal.actions.ActionContributorXML"
-                        class="org.eclipse.wst.sse.ui.StructuredTextEditor"
-                        symbolicFontName="org.eclipse.wst.sse.ui.textfont"
-                        id="org.eclipse.core.runtime.xml.source">
-                        <contentTypeBinding
-                                contentTypeId="org.eclipse.core.runtime.xml" />
-                        <contentTypeBinding
-                                contentTypeId="org.eclipse.wst.xml.core.xmlsource" />
-                </editor>
-        </extension>
-        	<extension point="org.eclipse.ui.editors">
-		<editor
-			name="%JavaScript_Source_Page_Editor.name"
-			icon="icons/sourceEditor.gif"
-			extensions="js"
-			contributorClass="org.eclipse.wst.javascript.ui.internal.actions.ActionContributorJS"
-			class="org.eclipse.wst.javascript.ui.internal.editor.JSEditor"
-			symbolicFontName="org.eclipse.wst.sse.ui.textfont"
-			id="org.eclipse.wst.javascript.core.javascriptsource.source">
-			<contentTypeBinding
-				contentTypeId="org.eclipse.wst.javascript.core.javascriptsource" />
-		</editor>
-	</extension>
-</plugin>
\ No newline at end of file
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.java
deleted file mode 100644
index a2ea5b3..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterListTestSuite.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.sse.unittests;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsp.core.tests.JSPCoreTestSuite;
-import org.eclipse.jst.jsp.tests.encoding.JSPEncodingTestSuite;
-import org.eclipse.jst.jsp.ui.tests.JSPUITestSuite;
-import org.eclipse.wst.css.core.tests.CSSCoreTestSuite;
-import org.eclipse.wst.css.tests.encoding.CSSEncodingTestSuite;
-import org.eclipse.wst.css.ui.tests.CSSUITestSuite;
-import org.eclipse.wst.dtd.ui.tests.DTDUITestSuite;
-import org.eclipse.wst.html.core.tests.HTMLCoreTestSuite;
-import org.eclipse.wst.html.tests.encoding.HTMLEncodingTestSuite;
-import org.eclipse.wst.html.ui.tests.HTMLUITestSuite;
-import org.eclipse.wst.sse.core.tests.SSEModelTestSuite;
-import org.eclipse.wst.sse.ui.tests.SSEUITestSuite;
-import org.eclipse.wst.xml.core.tests.SSEModelXMLTestSuite;
-import org.eclipse.wst.xml.tests.encoding.EncodingTestSuite;
-import org.eclipse.wst.xml.ui.tests.XMLUITestSuite;
-import org.eclipse.wst.xml.validation.tests.internal.AllXMLTests;
-import org.eclipse.wst.xsd.validation.tests.internal.AllXSDTests;
-
-/*****************************************************************************
- * Copyright (c) 2004 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and
- * is available at http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: IBM Corporation - initial API and implementation
- * 
- ****************************************************************************/
-
-public class MasterListTestSuite extends TestSuite {
-
-	public MasterListTestSuite() {
-		super("All Tests");
-		
-		System.setProperty("wtp.autotest.noninteractive", "true");
-
-		addTest(SSEModelTestSuite.suite());
-		addTest(SSEModelXMLTestSuite.suite());
-		addTest(CSSCoreTestSuite.suite());
-		addTest(HTMLCoreTestSuite.suite());
-		addTest(JSPCoreTestSuite.suite());
-
-		addTest(AllXMLTests.suite());
-		
-		addTest(EncodingTestSuite.suite());
-		addTest(CSSEncodingTestSuite.suite());
-		addTest(HTMLEncodingTestSuite.suite());
-		addTest(JSPEncodingTestSuite.suite());
-
-		addTest(CSSUITestSuite.suite());
-		addTest(HTMLUITestSuite.suite());
-		addTest(SSEUITestSuite.suite());
-		addTest(XMLUITestSuite.suite());
-		addTest(DTDUITestSuite.suite());
-		addTest(JSPUITestSuite.suite());
-		
-		addTest(AllXSDTests.suite());
-		//addTest(RegressionBucket.suite());
-		//addTest(AllTestCases.suite());
-
-	}
-
-	public void testAll() {
-		// this method needs to exist, but doesn't really do anything
-		// other than to signal to create an instance of this class.
-		// The rest it automatic from the tests added in constructor. 
-	}
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.java
deleted file mode 100644
index 8491014..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/MasterPerformanceTestSuite.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.sse.unittests;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.jst.jsp.ui.tests.performance.JSPUIPerformanceTests;
-import org.eclipse.wst.css.ui.tests.performance.CSSUIPerformanceTestSuite;
-import org.eclipse.wst.html.ui.tests.performance.HTMLUIPerformanceTestSuite;
-import org.eclipse.wst.sse.ui.tests.performance.SSEUIPerformanceTestSuite;
-import org.eclipse.wst.xml.ui.tests.performance.XMLUIPerformanceTestSuite;
-
-/*****************************************************************************
- * Copyright (c) 2004 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms
- * of the Eclipse Public License v1.0 which accompanies this distribution, and
- * is available at http://www.eclipse.org/legal/epl-v10.html
- * 
- * Contributors: IBM Corporation - initial API and implementation
- * 
- ****************************************************************************/
-
-public class MasterPerformanceTestSuite extends TestSuite {
-
-	public MasterPerformanceTestSuite() {
-		super("All Tests");
-
-		addTest(JSPUIPerformanceTests.suite());
-		addTest(CSSUIPerformanceTestSuite.suite());
-		addTest(HTMLUIPerformanceTestSuite.suite());
-		addTest(SSEUIPerformanceTestSuite.suite());
-		addTest(XMLUIPerformanceTestSuite.suite());
-
-
-	}
-
-	public void testAll() {
-		// this method needs to exist, but doesn't really do anything
-	}
-
-}
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.java
deleted file mode 100644
index 300d5e5..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/TestStringUtils.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.sse.unittests.minortools;
-
-
-
-public class TestStringUtils {
-
-	/**
-	 * TestStringUtils constructor comment.
-	 */
-	private TestStringUtils() {
-		super();
-	}
-
-	/**
-	 * 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;
-	}
-
-}
\ No newline at end of file
diff --git a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java b/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.java
deleted file mode 100644
index 811a668..0000000
--- a/development/org.eclipse.wst.sse.unittests/src/org/eclipse/wst/sse/unittests/minortools/VersionRemover.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.sse.unittests.minortools;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.eclipse.wst.xml.core.tests.util.CommonXML;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-
-
-/**
- * Modifies plugin.xml and fragment.xml files to not require specific versions
- * of their plugin dependencies.
- * 
- * @author nitin
- */
-public class VersionRemover {
-
-	char[] charbuff = new char[2048];
-	StringBuffer s = null;
-
-	public VersionRemover() {
-		super();
-	}
-
-
-
-	public static void main(String[] args) {
-		if (args.length < 1)
-			new VersionRemover().visit(new File("d:/target"));
-		else
-			new VersionRemover().visit(new File(args[0]));
-	}
-
-
-
-	protected void visit(File file) {
-		// Skip directories like org.eclipse.*, org.apache.*, and org.junit.*
-		if (file.isDirectory() && !file.getName().startsWith("org.eclipse.") && !file.getName().startsWith("org.apache") && !file.getName().startsWith("org.junit")) {
-			String[] contents = file.list();
-			for (int i = 0; i < contents.length; i++)
-				visit(new File(file.getAbsolutePath() + '/' + contents[i]));
-		}
-		else {
-			fixupFile(file);
-		}
-	}
-
-	protected void fixupFile(File file) {
-		// only load and fixup files named plugin.xml or fragment.xml under eclipse\plugins\XXXXXXX.*
-		if (!(file.getName().equalsIgnoreCase("plugin.xml") || file.getName().equalsIgnoreCase("fragment.xml")) || file.getAbsolutePath().indexOf("eclipse\\plugins\\XXXXXXX.") == -1)
-			return;
-		//		System.out.println(file.getAbsolutePath());
-		try {
-			Document doc = CommonXML.getDocumentBuilder().parse(file);
-			NodeList imports = null;
-			if (file.getName().equalsIgnoreCase("plugin.xml"))
-				imports = doc.getElementsByTagName("import");
-			else if (file.getName().equalsIgnoreCase("fragment.xml"))
-				imports = doc.getElementsByTagName("fragment");
-			boolean changed = false;
-			for (int i = 0; i < imports.getLength(); i++) {
-				Node importNode = imports.item(i);
-				if (importNode.getNodeName().equalsIgnoreCase("import") && importNode.getAttributes().getNamedItem("version") != null) {
-					changed = true;
-					importNode.getAttributes().removeNamedItem("version");
-				}
-				if (importNode.getAttributes().getNamedItem("plugin-version") != null) {
-					changed = true;
-					importNode.getAttributes().removeNamedItem("plugin-version");
-				}
-				if (importNode.getAttributes().getNamedItem("match") != null) {
-					importNode.getAttributes().removeNamedItem("match");
-					changed = true;
-				}
-			}
-			if (changed) {
-				FileOutputStream ostream = new FileOutputStream(file.getAbsolutePath());
-				CommonXML.serialize(doc, ostream);
-				ostream.close();
-				System.out.println("Modified " + file.getAbsolutePath());
-			}
-		}
-		catch (SAXException e) {
-			System.err.println(file.getPath() + ": " + e);
-		}
-		catch (IOException e) {
-			System.err.println(file.getPath() + ": " + e);
-		}
-	}
-}
\ No newline at end of file
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml b/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml
index 3abddee..bac1fef 100644
--- a/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml
+++ b/docs/org.eclipse.jst.jsp.ui.infopop/EditorJspContexts.xml
@@ -22,13 +22,13 @@
 </context>
 
 <context id="jspr0010">
-<description>Select this option to open the <b>Refactor Rename</b> dialog, if applicable, which lets you rename the currently selected Java element and references to that element.
+<description>Select this option to open the <b>Rename Resource</b> dialog, if applicable, which lets you rename the currently selected Java element and references to that element.
 </description>
 <topic label="Source editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
 <topic label="Editing source code - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
 </context>
 <context id="jspr0020">
-<description>Select this option to open the <b>Refactor Move</b> dialog, if applicable, which lets you move the currently selected Java element. For example, you can move a method from one class to another.
+<description>Select this option to open the <b>Move</b> dialog, if applicable, which lets you move the currently selected Java element. For example, you can move a method from one class to another.
 </description>
 <topic label="Source editors for markup languages" href="../org.eclipse.wst.sse.doc.user/topics/csrcedt004.html"/>
 <topic label="Editing source code - overview" href="../org.eclipse.wst.sse.doc.user/topics/tsrcedt000.html"/>
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF
index 6f869a8..57c07b0 100644
--- a/docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.jst.jsp.ui.infopop/META-INF/MANIFEST.MF
@@ -2,7 +2,6 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: %Plugin.name
 Bundle-SymbolicName: org.eclipse.jst.jsp.ui.infopop; singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Vendor: Eclipse.org
+Bundle-Version: 1.0.2.qualifier
+Bundle-Vendor: %Bundle-Vendor.0
 Bundle-Localization: plugin
-Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/build.properties b/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
index ce4c693..33cb6c7 100644
--- a/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
+++ b/docs/org.eclipse.jst.jsp.ui.infopop/build.properties
@@ -2,13 +2,12 @@
                EditorJspContexts2.xml,\
                about.html,\
                plugin.xml,\
-               META-INF,\
-               /,\
+               META-INF/,\
                META-INF/,\
                EditorJspContexts2.xml,\
                EditorJspContexts.xml,\
                about.html,\
                plugin.properties,\
-               plugin.xml
-               plugin.properties/
+               plugin.xml,\
+               plugin.properties
 src.includes = build.properties
diff --git a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties b/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
index fc2e115..138c44e 100644
--- a/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
+++ b/docs/org.eclipse.jst.jsp.ui.infopop/plugin.properties
@@ -3,3 +3,5 @@
 # Translation Instruction: section to be translated
 # ==============================================================================
 Plugin.name = JSP tools infopops
+
+Bundle-Vendor.0 = Eclipse.org
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF
index 0e4b207..33c30e1 100644
--- a/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.doc.user/META-INF/MANIFEST.MF
@@ -1,8 +1,8 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: master user doc toc
+Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.doc.user; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.1.qualifier
 Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.doc.user/plugin.properties b/docs/org.eclipse.wst.doc.user/plugin.properties
index 2e49616..6163b89 100644
--- a/docs/org.eclipse.wst.doc.user/plugin.properties
+++ b/docs/org.eclipse.wst.doc.user/plugin.properties
@@ -8,4 +8,6 @@
 # Contributors:
 #     IBM Corporation - initial API and implementation
 ###############################################################################
-providerName=Eclipse.org
+
+pluginName   = Master User Doc TOC
+providerName = Eclipse.org
diff --git a/docs/org.eclipse.wst.doc.user/toc.xml b/docs/org.eclipse.wst.doc.user/toc.xml
index aee7225..84f6f6c 100644
--- a/docs/org.eclipse.wst.doc.user/toc.xml
+++ b/docs/org.eclipse.wst.doc.user/toc.xml
@@ -39,18 +39,15 @@
 		<link toc="../org.eclipse.jst.ws.doc.user/webservice_toc.xml" />
 	</topic>
 	<topic label="Using data tools">
-		<link
-			toc="../org.eclipse.wst.datatools.connection.ui.doc.user/connection_ui_toc.xml" />
-		<link
-			toc="../org.eclipse.wst.datatools.fe.ui.doc.user/fe_ui_toc.xml" />
 		<link toc="../org.eclipse.wst.datatools.server.ui.doc.user/database_explorer_toc.xml" />
-		<link toc="../org.eclipse.wst.datatools.outputview.ui.doc.user/dataoutput_view_toc.xml" />
+		<link toc="../org.eclipse.wst.datatools.server.ui.doc.user/dataoutput_view_toc.xml" />
+		<link toc="../org.eclipse.wst.datatools.connection.ui.doc.user/connection_ui_toc.xml" />
+		<link toc="../org.eclipse.wst.datatools.fe.ui.doc.user/fe_ui_toc.xml" />
 		<link toc="../org.eclipse.wst.datatools.data.ui.doc.user/data_ui_toc.xml" />
 		<link toc="../org.eclipse.wst.sqleditor.doc.user/sqleditor_toc.xml" />
 	</topic>
 	<topic label="Using the server tools">
-		<link toc="../org.eclipse.wst.server.ui.doc.user/build_toc.xml" />
-		<link toc="../org.eclipse.jst.server.ui.doc.user/build_toc.xml" />
+  		<link toc="../org.eclipse.wst.server.ui.doc.user/wtp_main_toc.xml" />
 	</topic>
 	<topic label="Legal" href="notices.html" />
 </toc>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml b/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml
index ecb3e57..0cf4da1 100644
--- a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml
+++ b/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts.xml
@@ -13,51 +13,42 @@
  *******************************************************************************/ -->
 
 <contexts>
-	<context id="csh_outer_container">
-		<description/>
-	</context>
-	<context id="webx0020">
-		<description>
-			This page lets you specify the line delimiter and the text encoding that will be used when you create or save a document type definition (DTD) file.
+<context id="csh_outer_container">
+<description/>
+</context>
+<context id="webx0020">
+<description>This page lets you specify the line delimiter and the text encoding that will be used when you create or save a document type definition (DTD) file.
 
-			The line delimiters are Ctrl-J (UNIX), Ctrl-M (Mac), or Ctrl-M Ctrl-J (Windows).
-		</description>
-	</context>
-	<context id="webx0021">
-		<description>
-			This page lets you customize the syntax highlighting that the document type definition (DTD) editor does when you are editing a file.
+The line delimiters are Ctrl-J (UNIX), Ctrl-M (Mac), or Ctrl-M Ctrl-J (Windows).</description>
+</context>
+<context id="webx0021">
+<description>This page lets you customize the syntax highlighting that the document type definition (DTD) editor does when you are editing a file.
 
-			The <b>Content type</b> field contains a list of all the source types that you can select a highlighting style for. You can either select the content type that you want to work with from the drop-down list, or click text in the text sample window that corresponds to the content type for which you want to change the text highlighting.
+The <b>Content type</b> field contains a list of all the source types that you can select a highlighting style for. You can either select the content type that you want to work with from the drop-down list, or click text in the text sample window that corresponds to the content type for which you want to change the text highlighting.
 
-			The <b>Foreground</b> and <b>Background</b> push buttons open <b>Color</b> dialog boxes that allow you to specify text foreground and background colors, respectively. Select the <b>Bold</b> check box to make the specified content type appear in bold.
+The <b>Foreground</b> and <b>Background</b> push buttons open <b>Color</b> dialog boxes that allow you to specify text foreground and background colors, respectively. Select the <b>Bold</b> check box to make the specified content type appear in bold.
 
-			Click the <b>Restore Default</b> push button to set the highlighting styles back to their default values.
-		</description>
-		<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html" label="Setting source highlighting styles"/>
-	</context>
-	<context id="webx0022">
-		<description>
-			Templates are a chunk of predefined code that you can insert into a DTD file when it is created.
+Click the <b>Restore Default</b> push button to set the highlighting styles back to their default values.</description>
+<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tedtsrcst.html" label="Setting source highlighting styles"/>
+</context>
+<context id="webx0022">
+<description>Templates are a chunk of predefined code that you can insert into a DTD file when it is created.
 
-			Click <b>New</b> if you want to create a completely new template.
+Click <b>New</b> if you want to create a completely new template.
 
-			Supply a new template <b>Name</b> and <b>Description</b>. The <b>Context</b> for the template is the context in which the template is available in the proposal list when content assist is requested. Specify the <b>Pattern</b> for your template using the appropriate tags, attributes, or attribute values to be inserted by content assist.
+Supply a new template <b>Name</b> and <b>Description</b>. The <b>Context</b> for the template is the context in which the template is available in the proposal list when content assist is requested. Specify the <b>Pattern</b> for your template using the appropriate tags, attributes, or attribute values to be inserted by content assist.
 
-			If you want to insert a variable, click the <b>Insert Variable</b> button and select the variable to be inserted. For example, the <b>date</b> variable indicates the current date will be inserted.
+If you want to insert a variable, click the <b>Insert Variable</b> button and select the variable to be inserted. For example, the <b>date</b> variable indicates the current date will be inserted.
 
-			You can edit, remove, import, or export a template by using the same Preferences page.
+You can edit, remove, import, or export a template by using the same Preferences page.
 
-			If you have a template that you do not want to remove but you no longer want it to appear in the content assist list, clear its check box in the <b>Templates</b> preferences page.
-
-		</description>
-		<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html" label="Working with DTD templates"/>
-		<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html" label="Creating DTD files"/>
-	</context>
-	<context id="dtdw0010">
-		<description>
-			Click the <b>Use DTD Template</b> check box if you want to use a DTD template as the initial content in your new DTD page. A list of available DTD templates is listed - select the one you want to use. A preview of your DTD file is shown once you select a DTD template.
-		</description>
-		<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html" label="Working with DTD templates"/>
-		<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html" label="Creating DTD files"/>
-	</context>
+If you have a template that you do not want to remove but you no longer want it to appear in the content assist list, clear its check box in the <b>Templates</b> preferences page.</description>
+<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html" label="Working with DTD templates"/>
+<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html" label="Creating DTD files"/>
+</context>
+<context id="dtdw0010">
+<description>Click the <b>Use DTD Template</b> check box if you want to use a DTD template as the initial content in your new DTD page. A list of available DTD templates is listed - select the one you want to use. A preview of your DTD file is shown once you select a DTD template.</description>
+<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tdtemplt.html" label="Working with DTD templates"/>
+<topic href="../org.eclipse.wst.dtdeditor.doc.user/topics/tcretdtd.html" label="Creating DTD files"/>
+</context>
 </contexts>
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml b/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml
index f8e6f83..3a44d26 100644
--- a/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml
+++ b/docs/org.eclipse.wst.dtd.ui.infopop/EditorDtdContexts2.xml
@@ -13,14 +13,13 @@
  *******************************************************************************/ -->
 
 <contexts>
-	<context id="csh_outer_container">
-		<description/>
-	</context>
-	<context id="dtdsource_source_HelpId">
-		<description>
-			The DTD editor lets you edit a document type definition.
+<context id="csh_outer_container">
+<description/>
+</context>
+<context id="dtdsource_source_HelpId">
+<description>The DTD editor lets you edit a document type definition.
 
-			The editor provides text editing features such as syntax highlighting and unlimited undo and redo.
-		</description>
-	</context>
+The editor provides text editing features such as syntax highlighting and unlimited undo and redo.
+</description>
+</context>
 </contexts>
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
index 84f7de6..b7ecc4e 100644
--- a/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.dtd.ui.infopop/META-INF/MANIFEST.MF
@@ -1,8 +1,8 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: DTD infopops
+Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtd.ui.infopop; singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Vendor: Eclipse.org
+Bundle-Version: 1.0.1.qualifier
+Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
 Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties b/docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties
index ba0e6f2..76c52ba 100644
--- a/docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties
+++ b/docs/org.eclipse.wst.dtd.ui.infopop/plugin.properties
@@ -1,3 +1,13 @@
-# NLS_MESSAGEFORMAT_VAR
+###############################################################################
+# Copyright (c) 2001, 2004 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.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 = DTD Editor infopops
+pluginName     = DTD Editor infopops
+pluginProvider = Eclipse.org
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml
index 6b48249..ad1932c 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/DTDEditormap_toc.xml
@@ -12,7 +12,7 @@
  *******************************************************************************/ -->
  
 <toc label="DTD Editor">
-   <topic label="Working with DTDs" topic="topics/cworkdtds.html">
+   <topic label="Working with DTDs" href="topics/cworkdtds.html">
       <topic label="Creating DTDs" href="topics/tcretdtd.html">
          <topic label="Document type definitions (DTDs) - overview" href="topics/cdtdover.html"/>
            <topic label="Setting source highlighting styles" href="topics/tedtsrcst.html"/>
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF
index 9bd2708..d402dcd 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/META-INF/MANIFEST.MF
@@ -1,8 +1,7 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: DTD Editor documentation
+Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.dtdeditor.doc.user; singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Vendor: Eclipse.org
+Bundle-Version: 1.0.2.qualifier
+Bundle-Vendor: %pluginProvider
 Bundle-Localization: plugin
-Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/build.properties b/docs/org.eclipse.wst.dtdeditor.doc.user/build.properties
index 169d040..401fe92 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/build.properties
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/build.properties
@@ -1,6 +1,5 @@
 bin.includes = DTDEditormap_toc.xml,\
                about.html,\
-               dtdeditor_reference_toc.xml,\
                images/,\
                plugin.properties,\
                plugin.xml,\
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties b/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties
index e9909ab..d10ce86 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/plugin.properties
@@ -1,3 +1,4 @@
 # NLS_MESSAGEFORMAT_VAR
 
-Plugin.name = DTD Editor
+pluginName     = DTD Editor documentation
+pluginProvider = Eclipse.org
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html
index 67d7224..65abeee 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cdtdover.html
@@ -46,8 +46,5 @@
 <a href="../topics/tvaldtd.html" title="Validating a DTD file lets you verify that it is well formed and does not contain any errors.">Validating DTDs</a><br />
 </p>
 </div>
-		<p>
-		(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.
-		</p> 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html
index e5d7d29..2b7bba0 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/cworkdtds.html
@@ -40,9 +40,6 @@
 These DTD editor icons appear in the Outline view.</li>
 </ul>
 </div></body>
-</html>
-		<p>
-		(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.
-		</p> 
+</html> 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html
index 098e8f1..9faf52d 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/rdtdicons.html
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html
   PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html>
+<head>
 <!-- /*******************************************************************************
  * Copyright (c) 2000, 2005 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
@@ -11,8 +13,6 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/ -->
-<html>
-<head>
 <link rel="stylesheet" type="text/css" href="../org.eclipse.wst.doc.user/common.css" />
 <title>Icons used in the DTD editor</title>
 </head>
@@ -72,8 +72,5 @@
 </p>
 
 </div>
-		<p>
-		(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.
-		</p> 
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html
index 973982a..a64dc83 100644
--- a/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html
+++ b/docs/org.eclipse.wst.dtdeditor.doc.user/topics/tvaldtd.html
@@ -46,7 +46,12 @@
 <p>
 <b class="parentlink">Parent topic:</b> <a href="../topics/cworkdtds.html" title="Working with DTDs">Working with DTDs</a><br />
 </p>
-
 </div>
+
+<div><div class="relinfo"><strong>Related information</strong><br />
+<div><a href="../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html" title="General validation information">../../org.eclipse.jst.j2ee.doc.user/topics/tjval.html</a></div>
+</div>
+</div>
+
 </body>
 </html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
index 12b00d1..0b50faf 100644
--- a/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.html.ui.infopop/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: HTML editor infopops
 Bundle-SymbolicName: org.eclipse.wst.html.ui.infopop; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
 Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
index 2551bf5..4829ed3 100644
--- a/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.sse.doc.user/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: Structured text editor and snippets documentation
 Bundle-SymbolicName: org.eclipse.wst.sse.doc.user; singleton:=true
-Bundle-Version: 1.0.0
+Bundle-Version: 1.0.0.qualifier
 Bundle-Vendor: Eclipse.org
 Bundle-Localization: plugin
 Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts.xml b/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts.xml
deleted file mode 100644
index e69de29..0000000
--- a/docs/org.eclipse.wst.sse.ui.infopop/EditorCssContexts.xml
+++ /dev/null
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
index bf16c29..6af73d3 100644
--- a/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.sse.ui.infopop/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@
 Bundle-ManifestVersion: 2
 Bundle-Name: SSE infopops
 Bundle-SymbolicName: org.eclipse.wst.sse.ui.infopop; singleton:=true
-Bundle-Version: 1.0.0
+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/build.properties b/docs/org.eclipse.wst.sse.ui.infopop/build.properties
index 00318b9..6da2446 100644
--- a/docs/org.eclipse.wst.sse.ui.infopop/build.properties
+++ b/docs/org.eclipse.wst.sse.ui.infopop/build.properties
@@ -2,6 +2,5 @@
                about.html,\
                plugin.xml,\
                META-INF/,\
-               EditorCssContexts2.xml,\
-               EditorCssContexts.xml
+               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
index 4a55b99..2a3796f 100644
--- a/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml
+++ b/docs/org.eclipse.wst.sse.ui.infopop/plugin.xml
@@ -15,7 +15,6 @@
 
 <extension point="org.eclipse.help.contexts">
        <contexts file="EditorContexts.xml" plugin ="org.eclipse.wst.sse.ui"/>
-       <contexts file="EditorCssContexts.xml" plugin ="org.eclipse.wst.sse.ui"/>
        <contexts file="EditorCssContexts2.xml" plugin ="org.eclipse.wst.sse.ui"/>
 </extension>
 
diff --git a/docs/org.eclipse.wst.web.ui.infopop/.project b/docs/org.eclipse.wst.web.ui.infopop/.project
new file mode 100644
index 0000000..10c4a6e
--- /dev/null
+++ b/docs/org.eclipse.wst.web.ui.infopop/.project
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.web.ui.infopop</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+	</buildSpec>
+	<natures>
+	</natures>
+</projectDescription>
diff --git a/docs/org.eclipse.wst.web.ui.infopop/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.web.ui.infopop/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..ad5f8d2
--- /dev/null
+++ b/docs/org.eclipse.wst.web.ui.infopop/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Static Web infopop
+Bundle-SymbolicName: org.eclipse.wst.web.ui.infopop; singleton:=true
+Bundle-Version: 1.0.1.qualifier
+Bundle-Vendor: %pluginProvider
+Bundle-Localization: plugin
+Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.web.ui.infopop/StaticWebWizContexts.xml b/docs/org.eclipse.wst.web.ui.infopop/StaticWebWizContexts.xml
new file mode 100644
index 0000000..f933736
--- /dev/null
+++ b/docs/org.eclipse.wst.web.ui.infopop/StaticWebWizContexts.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?NLS type="org.eclipse.help.contexts"?>
+<!-- /*******************************************************************************
+ * Copyright (c) 2000, 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
+ *******************************************************************************/ -->
+<contexts>
+<context id="org.eclipse.wst.web.ui.webw2000">
+<description> Use this page to name your Web project and specify the file system location (the place where the resources you create are stored.) When the Use default check box is selected, the project will be created in the file system location where your workspace resides. To change the default file system location, clear the checkbox and locate the path using the <b>Browse</b> button. To configure additional options, select the <b>Next</b> button.
+In the Target Runtime field, select the server where you want to publish the Web project. if a server is not already defined, click <b>New</b> to select a server runtime environment. </description>
+<topic label="Creating a static Web project" href="../org.eclipse.wst.webtools.doc.user/topics/twcresta.html"/>
+</context>
+
+<context id="org.eclipse.wst.web.ui.webw2100">
+<description>Presets are used to define a default set of facet versions that will configure a project for a particular type of development. The Static Web Module facet enables the project to be deployed as a static
+Web module. Click Show Runtimes to view the available runtimes and runtime compositions.</description>
+<topic label="Creating a static Web project" href="../org.eclipse.wst.webtools.doc.user/topics/twcresta.html"/>
+</context>
+
+<context id="org.eclipse.wst.web.ui.webw2200">
+<description>The Web content folder is where the elements of your Web site such as Web pages, graphics and style sheets are stored. This directory structure is necessary to ensure that the content of your Web site will be included in the WAR file at deployment and that link validation will work correctly.
+</description>
+<topic label="Creating a static Web project" href="../org.eclipse.wst.webtools.doc.user/topics/twcresta.html"/>
+</context>
+
+
+</contexts>
diff --git a/docs/org.eclipse.wst.web.ui.infopop/about.html b/docs/org.eclipse.wst.web.ui.infopop/about.html
new file mode 100644
index 0000000..4c99086
--- /dev/null
+++ b/docs/org.eclipse.wst.web.ui.infopop/about.html
@@ -0,0 +1,22 @@
+<!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.web.ui.infopop/build.properties b/docs/org.eclipse.wst.web.ui.infopop/build.properties
new file mode 100644
index 0000000..d9a93d8
--- /dev/null
+++ b/docs/org.eclipse.wst.web.ui.infopop/build.properties
@@ -0,0 +1,6 @@
+bin.includes = StaticWebWizContexts.xml,\
+               about.html,\
+               plugin.xml,\
+               plugin.properties,\
+               META-INF/
+src.includes = build.properties
diff --git a/development/org.eclipse.wst.sse.unittests/plugin.properties b/docs/org.eclipse.wst.web.ui.infopop/plugin.properties
similarity index 72%
copy from development/org.eclipse.wst.sse.unittests/plugin.properties
copy to docs/org.eclipse.wst.web.ui.infopop/plugin.properties
index 535a870..b61d2de 100644
--- a/development/org.eclipse.wst.sse.unittests/plugin.properties
+++ b/docs/org.eclipse.wst.web.ui.infopop/plugin.properties
@@ -1,5 +1,5 @@
 ###############################################################################
-# Copyright (c) 2001, 2004 IBM Corporation and others.
+# Copyright (c) 2006 IBM Corporation and others.
 # All rights reserved. This program and the accompanying materials
 # are made available under the terms of the Eclipse Public License v1.0
 # which accompanies this distribution, and is available at
@@ -7,8 +7,7 @@
 # 
 # Contributors:
 #     IBM Corporation - initial API and implementation
-#     
 ###############################################################################
-XML_Source_Page_Editor.name=XML Source Page Editor
-JavaScript_Source_Page_Editor.name=JavaScript Source Page Editor
 
+pluginName     = Static Web infopop
+pluginProvider = Eclipse.org
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.web.ui.infopop/plugin.xml b/docs/org.eclipse.wst.web.ui.infopop/plugin.xml
new file mode 100644
index 0000000..20ac018
--- /dev/null
+++ b/docs/org.eclipse.wst.web.ui.infopop/plugin.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!-- ================================================= -->
+<!-- This is the plugin for declaring the help         -->
+<!-- contributions for using the tool.                 -->
+<!-- ================================================= -->
+<!-- /*******************************************************************************
+ * Copyright (c) 2000, 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
+ *******************************************************************************/ -->
+<plugin>
+
+<extension point="org.eclipse.help.contexts">
+      <contexts file="StaticWebWizContexts.xml" plugin ="org.eclipse.wst.web.ui"/>
+</extension>
+
+
+</plugin>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF b/docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF
index 1b83008..587f6f2 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF
+++ b/docs/org.eclipse.wst.webtools.doc.user/META-INF/MANIFEST.MF
@@ -1,8 +1,8 @@
 Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
-Bundle-Name: Web tools documentation
+Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.wst.webtools.doc.user; singleton:=true
-Bundle-Version: 1.0.0
-Bundle-Vendor: Eclipse.org
+Bundle-Version: 1.0.2.qualifier
+Bundle-Vendor: %providerName
 Bundle-Localization: plugin
 Eclipse-AutoStart: true
diff --git a/docs/org.eclipse.wst.webtools.doc.user/build.properties b/docs/org.eclipse.wst.webtools.doc.user/build.properties
index bb5cca9..6609225 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/build.properties
+++ b/docs/org.eclipse.wst.webtools.doc.user/build.properties
@@ -3,5 +3,6 @@
                about.html,\
                images/,\
                topics/,\
-               META-INF/
+               META-INF/,\
+               plugin.properties
 src.includes = build.properties
diff --git a/development/org.eclipse.wst.sse.unittests/plugin.properties b/docs/org.eclipse.wst.webtools.doc.user/plugin.properties
similarity index 80%
rename from development/org.eclipse.wst.sse.unittests/plugin.properties
rename to docs/org.eclipse.wst.webtools.doc.user/plugin.properties
index 535a870..acba026 100644
--- a/development/org.eclipse.wst.sse.unittests/plugin.properties
+++ b/docs/org.eclipse.wst.webtools.doc.user/plugin.properties
@@ -7,8 +7,7 @@
 # 
 # Contributors:
 #     IBM Corporation - initial API and implementation
-#     
 ###############################################################################
-XML_Source_Page_Editor.name=XML Source Page Editor
-JavaScript_Source_Page_Editor.name=JavaScript Source Page Editor
 
+pluginName   = Web tools documentation
+providerName = Eclipse.org
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html
index dad85c5..59b1d41 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccstatic.html
@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html
-  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
+  PUBLIC "-//IETF//DTD HTML 4.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html><head>
 <!-- /*******************************************************************************
  * Copyright (c) 2000, 2006 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
@@ -13,100 +12,67 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
+<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css"/>
 <title>Static Web projects</title>
 </head>
-<body id="ccstatic"><a name="ccstatic"><!--test --></a>
-
+<body id="ccstatic"><a name="ccstatic"><!-- --></a>
 <h1 class="topictitle1">Static Web projects</h1>
 <div><p>If you  want to create a content-based Web application that does not contain
-
 any dynamic content  (such as servlets, JSP files, filters, and associated
-
 metadata) you might prefer to create a static Web project, as opposed to a <a href="ccwebprj.html">dynamic Web project</a>.</p>
 <div class="p">Static Web projects have the following characteristics:  <ul><li>a Web content folder (called WebContent) for all publishable resources,
-
 You can change the name of this folder from the project's pop-up menu.</li>
 <li>a Theme folder, the suggested directory for storing cascading style sheets
-
 and other style-related objects.</li>
 <li>the ability to define folders outside of the Web content folder, for storing
-
 intermediate files, such as MIF files</li>
 <li>a conversion path from a static Web project to a dynamic Web project.
-
-If you decide to <a href="../../org.eclipse.wst.webtools.doc.user/topics/twpcnvrt.html">convert</a> the project, it will be a fully-valid dynamic
-
+If you decide to <a href="twpcnvrt.html">convert</a> the project, it will be a fully-valid dynamic
 Web project. </li>
 </ul>
 </div>
 <div class="p">In addition, your project will still have the following features (which
-
 are common to both static and dynamic Web projects ) : <ul><li>HTML syntax validation</li>
 <li>a broken link fix-up wizard</li>
 <li>a Web site navigation tool</li>
 <li>a new server type, the Static Web server, which makes it easy to publish
-
-static Web projects
-</li>
+static Web projects</li>
 </ul>
  </div>
 <p>The folder that a static Web project is published to is modifiable, so
-
-that when you set the publishing "root" value (called a <i>context root</i>),
-
+that when you set the publishing "root" value (called a <em>context root</em>),
 such as <samp class="codeph">/web1</samp>, for a static project, everything in the Web
-
 content folder will be published to the <span class="filepath">web1</span> folder under
-
 the Web server's doc root. This enables you to group Web resources on a Web
-
 server in folders that correspond to Web projects in the workbench. When projects
-
 defined in this way are ready for production, you can publish specific projects
-
 directly to the doc root by changing the value to <samp class="codeph">/</samp> and all
-
 publishing, link fixing, and browsing will update automatically.</p>
 <div class="p">Aliases can also be used to specify a context root value. For example,
-
 suppose that there is an alias that is defined on the target Web server, as
-
 follows: <pre>Alias /scripts/ "/var/www/scripts"</pre>
 In this
-
-example, in which the current static Web project will contain common JavaScript™ files,
-
+example, in which the current static Web project will contain common JavaScript&#8482; files,
 you can set the context root value to be <span>"scripts"</span>.  In order for
-
 the resources in the static Web project to be published to the correct location
-
 on the Web server, you must add this Alias mapping to the server tools instance
-
 of the static Web server, as follows.  <ol><li>From the Server view, double-click on the static Web server configuration
-
-to open the server configuration editor.<div class="note"><span class="notetitle">Note: </span>This assumes that you've already
-
+to open the server configuration editor.<div class="note"><span class="notetitle">Note:</span> This assumes that you've already
 defined the static Web server.</div>
 </li>
-<li>Click the <span class="uicontrol">Configuration</span> editor tab.</li>
-<li>Scroll down to the <span class="uicontrol">Alias Path Mapping</span> section,
-
+<li>Click the <b>Configuration</b> editor tab.</li>
+<li>Scroll down to the <b>Alias Path Mapping</b> section,
 and add the new Alias mapping.</li>
 </ol>
 Now that <span>"scripts"</span> is defined as an Alias, the Web content in
-
 the static Web project will be published to the mapped path, <span class="filepath">/var/www/scripts</span>.</div>
 </div>
-<div><p><b class="relconceptshd">Related concepts</b><br />
-<a href="ccwtover.html" title="">Web application overview</a><br />
-<a href="cwebdevelopmenttools.html" title="">Web development tools</a><br />
-<a href="ccwebprj.html" title="">Dynamic Web projects and applications</a><br />
-<a href="cwwarovr.html" title="">Web archive (WAR) files</a><br />
-</p>
-<!--<p><b class="reltaskshd">Related tasks</b><br />
-<br />
-</p>-->
+<div><div class="relconcepts"><strong>Related concepts</strong><br>
+<div><a href="cwebresources.html">Web resources</a></div>
+<div><a href="cwwarovr.html">Web archive (WAR) files</a></div>
 </div>
-</body>
-</html>
\ No newline at end of file
+<div class="reltasks"><strong>Related tasks</strong><br>
+<div><a href="twcresta.html">Creating a static Web project</a></div>
+</div>
+</div>
+</body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
index cceca0b..aaa9bbc 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebprj.html
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html
-  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
+  PUBLIC "-//IETF//DTD HTML 4.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html><head>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -13,207 +12,128 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
+<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css"/>
 <title>Dynamic Web projects and applications</title>
 </head>
 <body id="ccwebprj"><a name="ccwebprj"><!-- --></a>
-
 <h1 class="topictitle1">Dynamic Web projects and applications</h1>
-<div><p>There are two types of Web projects: dynamic and <a href="ccstatic.html">static</a>. Dynamic web projects can contain
-
-dynamic J2EE resources such as servlets, JSP files, filters, and associated
-
-metadata, in addition to static resources such as images and HTML files. Static
-
-web projects only contains static resources. When you create Web projects,
-
-you can include cascading style sheets and JSP tag libraries (for dynamic
-
-Web projects), so that you can begin development with a richer set of project
-
-resources.</p>
+<div><p>There are two types of Web projects: dynamic and <a href="ccstatic.html">static</a>. Dynamic web projects can contain dynamic J2EE
+resources such as servlets, JSP files, filters, and associated metadata, in
+addition to static resources such as images and HTML files. Static web projects
+only contains static resources. When you create Web projects, you can include
+cascading style sheets and JSP tag libraries (for dynamic Web projects), so
+that you can begin development with a richer set of project resources.</p>
 <p>Dynamic Web projects are always imbedded in Enterprise Application projects.
-
 The wizard that you use to create a dynamic Web project will also create an
-
 Enterprise Application (EAR) project if it does not already exist. The wizard
-
 will also update the <span class="filepath">application.xml</span> deployment descriptor
-
 of the specified Enterprise Application project to define the Web project
-
 as a module element. If you are importing a WAR file rather than creating
-
 a dynamic Web project new, the WAR Import wizard requires that you specify
-
 a Web project, which already requires an EAR project. </p>
 <p>J2EE conventions may represent extra overhead if you only want to create
-
 a static, content-based Web application, which contains no dynamic files,
-
 such as JSP files or servlets. In this case, when you need only the most basic
-
-Web project, you might want to use the <i>static</i> Web project type (see <a href="ccstatic.html">Static Web projects</a>). Note that static Web projects
-
-can  be converted to dynamic Web projects by selecting <b>Convert to a Dynamic
-
-Web Project</b>, from the Project menu.</p>
-<p>The J2EE model, and more specifically, the <cite>Sun Microsystems Java™ Servlet
-
+Web project, you might want to use the <em>static</em> Web project type (see <a href="ccstatic.html">Static Web projects</a>).  Note that
+static Web projects can  be converted to dynamic Web projects by selecting <strong>Convert
+to a Dynamic Web Project</strong>, from the Project menu.</p>
+<p>The J2EE model, and more specifically, the <cite>Sun Microsystems Java&#8482; Servlet
 2.3 Specification</cite>, defines a Web application directory structure that
-
 specifies the location of Web content files, class files, class paths, deployment
-
 descriptors, and supporting metadata. The Web project hierarchy mirrors that
-
 of the Web application created from a project. In the workbench, you can use
-
 the <span>New Web Project</span> wizard to create a new Web project.</p>
 <div class="p">The main project folder contains all development objects related to a Web
-
 application. The Web content folder contains the elements of the project necessary
-
 to create a Web application. This folder structure maps to the Web application
-
 archive (WAR) structure defined by Sun Microsystems.. The following default
-
-elements are located in the Web project folder hierarchy: <div class="note"><span class="notetitle">Note: </span>In the Project
-
+elements are located in the Web project folder hierarchy: <div class="note"><span class="notetitle">Note:</span> In the Project
 Explorer view, Web projects are filtered into folder nodes to customize the
-
 display of Web resources for easy management during development. For information
-
-on the filtered structure, see <a href="../../org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html">Project Explorer view</a>.</div>
-<dl><dt class="bold">Web Deployment Descriptor</dt>
+on the filtered structure, see <a href="ccwebvw.html">Project
+Explorer view</a>.</div>
+<dl><dt class="dlterm">Web Deployment Descriptor</dt>
 <dd>The standard Web application deployment descriptor (the <span class="filepath">web.xml</span> file).</dd>
-<dt class="bold">JavaSource</dt>
+<dt class="dlterm">JavaSource</dt>
 <dd>Contains the project's Java source code for classes, beans, and
-
 servlets. When these resources are added to a Web project, they are automatically
-
 compiled and the generated files are added to the WEB-INF/classes directory.
-
 The contents of the source directory are not packaged in WAR files unless
-
-an option is specified when a WAR file is created. <div class="note"><span class="notetitle">Note: </span>Though the default
-
+an option is specified when a WAR file is created. <div class="note"><span class="notetitle">Note:</span> Though the default
 name given to the folder is JavaSources, you can change the name through the
-
-Project Explorer view or through the Preferences page available by selecting <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">Web
-
-Tools</span> &gt; <span class="uicontrol">New J2EE Project</span></span>.</div>
+Project Explorer view or through the Preferences page available by selecting <span class="menucascade"><b>Window</b> &gt; <b>Preferences</b> &gt; <b>Web
+Tools</b> &gt; <b>New J2EE Project</b></span>.</div>
 </dd>
-<dt class="bold">imported_classes folder</dt>
+<dt class="dlterm">imported_classes folder</dt>
 <dd>This folder may be created during a WAR import, and contains class files
-
-that do not have accompanying source.  The <span class="uicontrol">imported_classes</span> folder
-
+that do not have accompanying source.  The <b>imported_classes</b> folder
 is a Java classes
-
-folder; Java classes folders can also be created using the
-
-Web project <span class="uicontrol">Java Build Path</span> properties page.</dd>
-<dt class="bold">WebContent folder</dt>
+folder; Java classes folders can also be created using the Web
+project <b>Java Build Path</b> properties page.</dd>
+<dt class="dlterm">WebContent folder</dt>
 <dd>The mandatory location of all Web resources, including HTML, JSP, graphic
-
 files, and so on. If the files are not placed in this directory (or in a subdirectory
-
 structure under this directory), the files will not be available when the
-
 application is executed on a server. The Web content folder represents the
-
 contents of the WAR file that will be deployed to the server. Any files not
-
 under the Web content folder are considered development-time resources (for
-
 example, .java files, .sql files, and .mif files), and are not deployed when
-
-the project is unit tested or published. <div class="note"><span class="notetitle">Note: </span>Though the default name given
-
+the project is unit tested or published. <div class="note"><span class="notetitle">Note:</span> Though the default name given
 to the folder is <span class="filepath">WebContent</span>, you can change the name
-
- in the Project Explorer by right-clicking the folder and selecting <span class="uicontrol">Rename</span> or
-
+ in the Project Explorer by right-clicking the folder and selecting <b>Rename</b> or
 from the Web page of the project's Properties dialog. In a dynamic Web project,
-
 changing the folder name will update the Java build output directory. You can change
-
 the preference for the default folder name to be applied when creating new
-
-Web projects by selecting <span class="menucascade"><span class="uicontrol">Window</span> &gt; <span class="uicontrol">Preferences</span> &gt; <span class="uicontrol">Web Tools</span> &gt; <span class="uicontrol">New J2EE Project</span></span>.</div>
+Web projects by selecting <span class="menucascade"><b>Window</b> &gt; <b>Preferences</b> &gt; <b>Web Tools</b> &gt; <b>New J2EE Project</b></span>.</div>
 </dd>
-<dt class="bold">META-INF</dt>
+<dt class="dlterm">META-INF</dt>
 <dd>This directory contains the <span class="filepath">MANIFEST.MF</span> file, which
-
 is used to map class paths for dependent JAR files that exist in other projects
-
 in the same Enterprise Application project. An entry in this file will update
-
 the run-time project class path and Java build settings to include the referenced
-
 JAR files.</dd>
-<dt class="bold">theme</dt>
+<dt class="dlterm">theme</dt>
 <dd>The suggested directory for cascading style sheets and other style-related
-
 objects.</dd>
-<dt class="bold">WEB-INF</dt>
-<dd>Based on the <cite>Sun Microsystems Java Servlet 2.3 Specification</cite>,
-
-this directory contains the supporting Web resources for a Web application,
-
-including the <span class="filepath">web.xml</span> file and the classes and lib directories.</dd>
-<dt class="bold">/classes</dt>
+<dt class="dlterm">WEB-INF</dt>
+<dd>Based on the <cite>Sun Microsystems Java Servlet 2.3 Specification</cite>, this
+directory contains the supporting Web resources for a Web application, including
+the <span class="filepath">web.xml</span> file and the classes and lib directories.</dd>
+<dt class="dlterm">/classes</dt>
 <dd>This directory is for servlets, utility classes, and the Java compiler
-
 output directory. The classes in this directory are used by the application
-
 class loader to load the classes. Folders in this directory will map package
-
 and class names, as in: <samp class="codeph">/WEB-INF/classes/com/mycorp/servlets/MyServlet.class</samp>.<p>Do
-
 not place any .class files directly into this directory. The .class files
-
-are placed in this directory automatically when the Java compiler compiles
-
-Java source files that are in the <span class="filepath">Java Resources</span> directory.
-
+are placed in this directory automatically when the Java compiler
+compiles Java source files that are in the <span class="filepath">Java Resources</span> directory.
 Any files placed directly in this directory will be deleted by the Java compiler
-
 when it runs.</p>
 </dd>
-<dt class="bold">/lib</dt>
+<dt class="dlterm">/lib</dt>
 <dd>The supporting JAR files that your Web application references. Any classes
-
 in .jar files placed in this directory will be available for your Web application</dd>
-<dt class="bold">Libraries</dt>
+<dt class="dlterm">Libraries</dt>
 <dd>The supporting JAR files that your Web application references. This folder
-
 mirrors the content of the lib folder. In addition, Web Library Projects,
-
 which are "virtual" JAR files that do not physically reside in the Web project,
-
 but are associated with Java projects elsewhere in your workspace,
-
 are included in this folder. They are packaged with your project when you
-
 export the application's WAR file.</dd>
 </dl>
- <div class="note"><span class="notetitle">Note: </span>A library entry on the Java build path will remain there unless
-
+ <div class="note"><span class="notetitle">Note:</span> A library entry on the Java build path will remain there unless
 the actual JAR file is deleted from the WEB-INF/lib folder. If you remove
-
 a library path entry but not the JAR file, the library entry will be re-added
-
 to the path automatically.</div>
 </div>
-<div class="p"><b>Related concepts</b>  <p><a href="ccwtover.html">Web application overview</a><br />
-<br />
-<a href="cwebdevelopmenttools.html">Web development tools</a><br />
-<br />
-<a href="ccstatic.html">Static Web projects</a><br />
-<br />
-<a href="cwwarovr.html">Web archive (WAR) files</a></p>
+</div>
+<div><div class="relconcepts"><strong>Related concepts</strong><br>
+<div><a href="cwebresources.html">Web resources</a></div>
+<div><a href="cwwarovr.html">Web archive (WAR) files</a></div>
+</div>
+<div class="reltasks"><strong>Related tasks</strong><br>
+<div><a href="twcreprj.html">Creating a dynamic Web project</a></div>
+<div><a href="tjcrejsp.html">Creating JavaServer Pages (JSP) files</a></div>
 </div>
 </div>
-</body>
-</html>
\ No newline at end of file
+</body></html>
\ No newline at end of file
diff --git a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html
index be1c8fa..0810e9f 100644
--- a/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html
+++ b/docs/org.eclipse.wst.webtools.doc.user/topics/ccwebvw.html
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE html
-  PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
+  PUBLIC "-//IETF//DTD HTML 4.0//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html><head>
 <!-- /*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation and others.
+ * Copyright (c) 2000, 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
@@ -13,96 +12,57 @@
  * Contributors:
  *     IBM Corporation - initial API and implementation
  *******************************************************************************/ -->
-<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css" />
+<link rel="stylesheet" type="text/css" href="../../org.eclipse.wst.doc.user/common.css"/>
 <title>Project Explorer view and Web development</title>
 </head>
 <body id="ccwebvw"><a name="ccwebvw"><!-- --></a>
-
 <h1 class="topictitle1">Project Explorer view and Web development</h1>
-<div><div class="skipspace"><div class="p">Depending on the product that you have installed, the Project Explorer view may contain the following features: <ul>
-
-
-<li><img src="../images/nwin.gif" alt="For Windows" /> You
-
-can drag and drop files from Windows<sup>®</sup> Explorer or the desktop into the
-
-Navigator view.</li>
-<li>View filtering is supported by selecting <span><span class="uicontrol">Filters</span></span> from
-
-the Navigator view <span><span class="uicontrol">Menu</span></span> button. Resources
-
+<div><div class="section"><div class="p">The Project Explorer view provides the following notable features: <ul><li><img src="../images/nwin.gif" alt="For Windows"> You can drag and drop files from Windows<sup>&reg;</sup> Explorer or the desktop into
+the Nav